@fluentui/react-radio 0.0.0-nightly-20220302-0405.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +305 -0
- package/CHANGELOG.md +106 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/Spec.md +292 -0
- package/dist/react-radio.d.ts +183 -0
- package/lib/Radio.d.ts +1 -0
- package/lib/Radio.js +2 -0
- package/lib/Radio.js.map +1 -0
- package/lib/RadioGroup.d.ts +1 -0
- package/lib/RadioGroup.js +2 -0
- package/lib/RadioGroup.js.map +1 -0
- package/lib/components/Radio/Radio.d.ts +6 -0
- package/lib/components/Radio/Radio.js +15 -0
- package/lib/components/Radio/Radio.js.map +1 -0
- package/lib/components/Radio/Radio.types.d.ts +52 -0
- package/lib/components/Radio/Radio.types.js +2 -0
- package/lib/components/Radio/Radio.types.js.map +1 -0
- package/lib/components/Radio/index.d.ts +5 -0
- package/lib/components/Radio/index.js +6 -0
- package/lib/components/Radio/index.js.map +1 -0
- package/lib/components/Radio/renderRadio.d.ts +5 -0
- package/lib/components/Radio/renderRadio.js +18 -0
- package/lib/components/Radio/renderRadio.js.map +1 -0
- package/lib/components/Radio/useRadio.d.ts +12 -0
- package/lib/components/Radio/useRadio.js +76 -0
- package/lib/components/Radio/useRadio.js.map +1 -0
- package/lib/components/Radio/useRadioStyles.d.ts +6 -0
- package/lib/components/Radio/useRadioStyles.js +174 -0
- package/lib/components/Radio/useRadioStyles.js.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts +6 -0
- package/lib/components/RadioGroup/RadioGroup.js +15 -0
- package/lib/components/RadioGroup/RadioGroup.js.map +1 -0
- package/lib/components/RadioGroup/RadioGroup.types.d.ts +58 -0
- package/lib/components/RadioGroup/RadioGroup.types.js +2 -0
- package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -0
- package/lib/components/RadioGroup/index.d.ts +5 -0
- package/lib/components/RadioGroup/index.js +6 -0
- package/lib/components/RadioGroup/index.js.map +1 -0
- package/lib/components/RadioGroup/renderRadioGroup.d.ts +5 -0
- package/lib/components/RadioGroup/renderRadioGroup.js +18 -0
- package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -0
- package/lib/components/RadioGroup/useRadioGroup.d.ts +12 -0
- package/lib/components/RadioGroup/useRadioGroup.js +51 -0
- package/lib/components/RadioGroup/useRadioGroup.js.map +1 -0
- package/lib/components/RadioGroup/useRadioGroupStyles.d.ts +6 -0
- package/lib/components/RadioGroup/useRadioGroupStyles.js +24 -0
- package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -0
- package/lib/contexts/RadioGroupContext.d.ts +7 -0
- package/lib/contexts/RadioGroupContext.js +7 -0
- package/lib/contexts/RadioGroupContext.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/tsdoc-metadata.json +11 -0
- package/lib-commonjs/Radio.d.ts +1 -0
- package/lib-commonjs/Radio.js +10 -0
- package/lib-commonjs/Radio.js.map +1 -0
- package/lib-commonjs/RadioGroup.d.ts +1 -0
- package/lib-commonjs/RadioGroup.js +10 -0
- package/lib-commonjs/RadioGroup.js.map +1 -0
- package/lib-commonjs/components/Radio/Radio.d.ts +6 -0
- package/lib-commonjs/components/Radio/Radio.js +26 -0
- package/lib-commonjs/components/Radio/Radio.js.map +1 -0
- package/lib-commonjs/components/Radio/Radio.types.d.ts +52 -0
- package/lib-commonjs/components/Radio/Radio.types.js +6 -0
- package/lib-commonjs/components/Radio/Radio.types.js.map +1 -0
- package/lib-commonjs/components/Radio/index.d.ts +5 -0
- package/lib-commonjs/components/Radio/index.js +18 -0
- package/lib-commonjs/components/Radio/index.js.map +1 -0
- package/lib-commonjs/components/Radio/renderRadio.d.ts +5 -0
- package/lib-commonjs/components/Radio/renderRadio.js +29 -0
- package/lib-commonjs/components/Radio/renderRadio.js.map +1 -0
- package/lib-commonjs/components/Radio/useRadio.d.ts +12 -0
- package/lib-commonjs/components/Radio/useRadio.js +90 -0
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -0
- package/lib-commonjs/components/Radio/useRadioStyles.d.ts +6 -0
- package/lib-commonjs/components/Radio/useRadioStyles.js +186 -0
- package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.d.ts +6 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.js +26 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.d.ts +58 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js +6 -0
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/index.d.ts +5 -0
- package/lib-commonjs/components/RadioGroup/index.js +18 -0
- package/lib-commonjs/components/RadioGroup/index.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.d.ts +5 -0
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +30 -0
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroup.d.ts +12 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js +62 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.d.ts +6 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +34 -0
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -0
- package/lib-commonjs/contexts/RadioGroupContext.d.ts +7 -0
- package/lib-commonjs/contexts/RadioGroupContext.js +15 -0
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -0
- package/lib-commonjs/index.d.ts +3 -0
- package/lib-commonjs/index.js +14 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +65 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
9
|
+
tslib_1.__exportStar(require("./RadioGroup"), exports);
|
10
|
+
|
11
|
+
tslib_1.__exportStar(require("./RadioGroup.types"), exports);
|
12
|
+
|
13
|
+
tslib_1.__exportStar(require("./renderRadioGroup"), exports);
|
14
|
+
|
15
|
+
tslib_1.__exportStar(require("./useRadioGroup"), exports);
|
16
|
+
|
17
|
+
tslib_1.__exportStar(require("./useRadioGroupStyles"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/RadioGroup/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './RadioGroup';\nexport * from './RadioGroup.types';\nexport * from './renderRadioGroup';\nexport * from './useRadioGroup';\nexport * from './useRadioGroupStyles';\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderRadioGroup_unstable = void 0;
|
7
|
+
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
|
12
|
+
const RadioGroupContext_1 = /*#__PURE__*/require("../../contexts/RadioGroupContext");
|
13
|
+
/**
|
14
|
+
* Render the final JSX of RadioGroup
|
15
|
+
*/
|
16
|
+
|
17
|
+
|
18
|
+
const renderRadioGroup_unstable = state => {
|
19
|
+
const {
|
20
|
+
slots,
|
21
|
+
slotProps
|
22
|
+
} = react_utilities_1.getSlots(state);
|
23
|
+
return React.createElement(RadioGroupContext_1.RadioGroupContext.Provider, {
|
24
|
+
value: state.context
|
25
|
+
}, React.createElement(slots.root, { ...slotProps.root
|
26
|
+
}));
|
27
|
+
};
|
28
|
+
|
29
|
+
exports.renderRadioGroup_unstable = renderRadioGroup_unstable;
|
30
|
+
//# sourceMappingURL=renderRadioGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/RadioGroup/renderRadioGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,mBAAA,CAAA,iBAAA,CAAkB,QAAnB,EAA2B;AAAC,IAAA,KAAK,EAAE,KAAK,CAAC;AAAd,GAA3B,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={state.context}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,12 @@
|
|
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;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useRadioGroup_unstable = void 0;
|
7
|
+
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
/**
|
12
|
+
* Create the state required to render RadioGroup.
|
13
|
+
*
|
14
|
+
* The returned state can be modified with hooks such as useRadioGroupStyles_unstable,
|
15
|
+
* before being passed to renderRadioGroup_unstable.
|
16
|
+
*
|
17
|
+
* @param props - props from this instance of RadioGroup
|
18
|
+
* @param ref - reference to root HTMLElement of RadioGroup
|
19
|
+
*/
|
20
|
+
|
21
|
+
|
22
|
+
const useRadioGroup_unstable = (props, ref) => {
|
23
|
+
const generatedName = react_utilities_1.useId('radiogroup-');
|
24
|
+
const {
|
25
|
+
name = generatedName,
|
26
|
+
value,
|
27
|
+
defaultValue,
|
28
|
+
disabled,
|
29
|
+
layout = 'vertical',
|
30
|
+
onChange
|
31
|
+
} = props;
|
32
|
+
return {
|
33
|
+
layout,
|
34
|
+
context: React.useMemo(() => ({
|
35
|
+
name,
|
36
|
+
value,
|
37
|
+
defaultValue,
|
38
|
+
disabled,
|
39
|
+
layout
|
40
|
+
}), [name, layout, value, defaultValue, disabled]),
|
41
|
+
components: {
|
42
|
+
root: 'div'
|
43
|
+
},
|
44
|
+
root: {
|
45
|
+
ref,
|
46
|
+
role: 'radiogroup',
|
47
|
+
...react_utilities_1.getNativeElementProps('div', props,
|
48
|
+
/*excludedPropNames:*/
|
49
|
+
['onChange', 'name']),
|
50
|
+
onChange: react_utilities_1.useEventCallback(ev => {
|
51
|
+
if (onChange && ev.target instanceof HTMLInputElement && ev.target.type === 'radio') {
|
52
|
+
onChange(ev, {
|
53
|
+
value: ev.target.value
|
54
|
+
});
|
55
|
+
}
|
56
|
+
})
|
57
|
+
}
|
58
|
+
};
|
59
|
+
};
|
60
|
+
|
61
|
+
exports.useRadioGroup_unstable = useRadioGroup_unstable;
|
62
|
+
//# sourceMappingURL=useRadioGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/RadioGroup/useRadioGroup.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAA4E;AAChH,QAAM,aAAa,GAAG,iBAAA,CAAA,KAAA,CAAM,aAAN,CAAtB;AAEA,QAAM;AAAE,IAAA,IAAI,GAAG,aAAT;AAAwB,IAAA,KAAxB;AAA+B,IAAA,YAA/B;AAA6C,IAAA,QAA7C;AAAuD,IAAA,MAAM,GAAG,UAAhE;AAA4E,IAAA;AAA5E,MAAyF,KAA/F;AAEA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,OAAO,EAAE,KAAK,CAAC,OAAN,CACP,OAAO;AACL,MAAA,IADK;AAEL,MAAA,KAFK;AAGL,MAAA,YAHK;AAIL,MAAA,QAJK;AAKL,MAAA;AALK,KAAP,CADO,EAQP,CAAC,IAAD,EAAO,MAAP,EAAe,KAAf,EAAsB,YAAtB,EAAoC,QAApC,CARO,CAFJ;AAYL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAZP;AAeL,IAAA,IAAI,EAAE;AACJ,MAAA,GADI;AAEJ,MAAA,IAAI,EAAE,YAFF;AAGJ,SAAG,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B,KAA7B;AAAoC;AAAuB,OAAC,UAAD,EAAa,MAAb,CAA3D,CAHC;AAIJ,MAAA,QAAQ,EAAE,iBAAA,CAAA,gBAAA,CAAiB,EAAE,IAAG;AAC9B,YAAI,QAAQ,IAAI,EAAE,CAAC,MAAH,YAAqB,gBAAjC,IAAqD,EAAE,CAAC,MAAH,CAAU,IAAV,KAAmB,OAA5E,EAAqF;AACnF,UAAA,QAAQ,CAAC,EAAD,EAAK;AAAE,YAAA,KAAK,EAAE,EAAE,CAAC,MAAH,CAAU;AAAnB,WAAL,CAAR;AACD;AACF,OAJS;AAJN;AAfD,GAAP;AA0BD,CA/BM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, 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 } = props;\n\n return {\n layout,\n context: React.useMemo(\n () => ({\n name,\n value,\n defaultValue,\n disabled,\n layout,\n }),\n [name, layout, value, defaultValue, disabled],\n ),\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 (onChange && ev.target instanceof HTMLInputElement && ev.target.type === 'radio') {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { RadioGroupState } from './RadioGroup.types';
|
2
|
+
export declare const radioGroupClassName = "fui-RadioGroup";
|
3
|
+
/**
|
4
|
+
* Apply styling to the RadioGroup slots based on the state
|
5
|
+
*/
|
6
|
+
export declare const useRadioGroupStyles_unstable: (state: RadioGroupState) => void;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useRadioGroupStyles_unstable = exports.radioGroupClassName = void 0;
|
7
|
+
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
exports.radioGroupClassName = 'fui-RadioGroup';
|
11
|
+
|
12
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
13
|
+
"root": {
|
14
|
+
"mc9l5x": "f22iagw",
|
15
|
+
"Bt984gj": "f6jr5hl"
|
16
|
+
},
|
17
|
+
"vertical": {
|
18
|
+
"Beiy3e4": "f1vx9l62"
|
19
|
+
}
|
20
|
+
}, {
|
21
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f6jr5hl{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}"]
|
22
|
+
});
|
23
|
+
/**
|
24
|
+
* Apply styling to the RadioGroup slots based on the state
|
25
|
+
*/
|
26
|
+
|
27
|
+
|
28
|
+
const useRadioGroupStyles_unstable = state => {
|
29
|
+
const styles = useStyles();
|
30
|
+
state.root.className = react_1.mergeClasses(exports.radioGroupClassName, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
|
31
|
+
};
|
32
|
+
|
33
|
+
exports.useRadioGroupStyles_unstable = useRadioGroupStyles_unstable;
|
34
|
+
//# sourceMappingURL=useRadioGroupStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/RadioGroup/useRadioGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,mBAAA,GAAsB,gBAAtB;;AAEb,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,mBADqB,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 { RadioGroupState } from './RadioGroup.types';\n\nexport const radioGroupClassName = 'fui-RadioGroup';\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 radioGroupClassName,\n styles.root,\n state.layout === 'vertical' && styles.vertical,\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { RadioGroupProps } from '../RadioGroup';
|
3
|
+
export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'layout' | 'value' | 'defaultValue' | 'disabled'>;
|
4
|
+
/**
|
5
|
+
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
6
|
+
*/
|
7
|
+
export declare const RadioGroupContext: React.Context<RadioGroupContextValue>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.RadioGroupContext = void 0;
|
7
|
+
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
/**
|
10
|
+
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
11
|
+
*/
|
12
|
+
|
13
|
+
|
14
|
+
exports.RadioGroupContext = /*#__PURE__*/React.createContext({});
|
15
|
+
//# sourceMappingURL=RadioGroupContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAKA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAoB,KAAK,CAAC,aAAN,CAA4C,EAA5C,CAApB","sourcesContent":["import * as React from 'react';\nimport { RadioGroupProps } from '../RadioGroup';\n\nexport type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'layout' | 'value' | 'defaultValue' | 'disabled'>;\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext = React.createContext<RadioGroupContextValue>({});\n"],"sourceRoot":"../src/"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
9
|
+
tslib_1.__exportStar(require("./RadioGroup"), exports);
|
10
|
+
|
11
|
+
tslib_1.__exportStar(require("./Radio"), exports);
|
12
|
+
|
13
|
+
tslib_1.__exportStar(require("./contexts/RadioGroupContext"), exports);
|
14
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,8BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './RadioGroup';\nexport * from './Radio';\nexport * from './contexts/RadioGroupContext';\n"],"sourceRoot":"../src/"}
|
package/package.json
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
{
|
2
|
+
"name": "@fluentui/react-radio",
|
3
|
+
"version": "0.0.0-nightly-20220302-0405.1",
|
4
|
+
"description": "Fluent UI Radio component",
|
5
|
+
"main": "lib-commonjs/index.js",
|
6
|
+
"module": "lib/index.js",
|
7
|
+
"typings": "lib/index.d.ts",
|
8
|
+
"sideEffects": false,
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "https://github.com/microsoft/fluentui"
|
12
|
+
},
|
13
|
+
"license": "MIT",
|
14
|
+
"scripts": {
|
15
|
+
"build": "just-scripts build",
|
16
|
+
"clean": "just-scripts clean",
|
17
|
+
"code-style": "just-scripts code-style",
|
18
|
+
"just": "just-scripts",
|
19
|
+
"lint": "just-scripts lint",
|
20
|
+
"start": "yarn storybook",
|
21
|
+
"test": "jest --passWithNoTests",
|
22
|
+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-radio/src && yarn docs",
|
24
|
+
"storybook": "node ../../scripts/storybook/runner",
|
25
|
+
"type-check": "tsc -b tsconfig.json"
|
26
|
+
},
|
27
|
+
"devDependencies": {
|
28
|
+
"@fluentui/eslint-plugin": "*",
|
29
|
+
"@fluentui/react-conformance": "*",
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20220302-0405.1",
|
31
|
+
"@fluentui/scripts": "^1.0.0",
|
32
|
+
"@types/enzyme": "3.10.3",
|
33
|
+
"@types/enzyme-adapter-react-16": "1.0.3",
|
34
|
+
"@types/react": "16.9.42",
|
35
|
+
"@types/react-dom": "16.9.10",
|
36
|
+
"@types/react-test-renderer": "^16.0.0",
|
37
|
+
"enzyme": "~3.10.0",
|
38
|
+
"enzyme-adapter-react-16": "^1.15.0",
|
39
|
+
"react": "16.8.6",
|
40
|
+
"react-dom": "16.8.6",
|
41
|
+
"react-test-renderer": "^16.3.0"
|
42
|
+
},
|
43
|
+
"dependencies": {
|
44
|
+
"@fluentui/react-icons": "^2.0.159-beta.10",
|
45
|
+
"@fluentui/react-label": "0.0.0-nightly-20220302-0405.1",
|
46
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20220302-0405.1",
|
47
|
+
"@fluentui/react-theme": "0.0.0-nightly-20220302-0405.1",
|
48
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20220302-0405.1",
|
49
|
+
"@griffel/react": "1.0.0",
|
50
|
+
"tslib": "^2.1.0"
|
51
|
+
},
|
52
|
+
"peerDependencies": {
|
53
|
+
"@types/react": ">=16.8.0 <18.0.0",
|
54
|
+
"@types/react-dom": ">=16.8.0 <18.0.0",
|
55
|
+
"react": ">=16.8.0 <18.0.0",
|
56
|
+
"react-dom": ">=16.8.0 <18.0.0"
|
57
|
+
},
|
58
|
+
"beachball": {
|
59
|
+
"disallowedChangeTypes": [
|
60
|
+
"major",
|
61
|
+
"minor",
|
62
|
+
"patch"
|
63
|
+
]
|
64
|
+
}
|
65
|
+
}
|