@fluentui-react-native/radio-group 0.16.46 → 0.16.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +10 -2
- package/MIGRATION.md +94 -0
- package/SPEC.md +586 -0
- package/assets/controlled_radiogroup.png +0 -0
- package/assets/disabled_item.png +0 -0
- package/assets/disabled_radiogroup.png +0 -0
- package/assets/horizontal_radiogroup.png +0 -0
- package/assets/horizontal_stacked_radiogroup.png +0 -0
- package/assets/required_radiogroup.png +0 -0
- package/assets/subtext_radiogroup.png +0 -0
- package/assets/uncontrolled_radiogroup.png +0 -0
- package/lib/Radio/Radio.d.ts +13 -0
- package/lib/Radio/Radio.d.ts.map +1 -0
- package/lib/Radio/Radio.js +48 -0
- package/lib/Radio/Radio.js.map +1 -0
- package/lib/Radio/Radio.styling.d.ts +5 -0
- package/lib/Radio/Radio.styling.d.ts.map +1 -0
- package/lib/Radio/Radio.styling.js +78 -0
- package/lib/Radio/Radio.styling.js.map +1 -0
- package/lib/Radio/Radio.types.d.ts +185 -0
- package/lib/Radio/Radio.types.d.ts.map +1 -0
- package/lib/Radio/Radio.types.js +2 -0
- package/lib/Radio/Radio.types.js.map +1 -0
- package/lib/Radio/RadioTokens.android.d.ts +5 -0
- package/lib/Radio/RadioTokens.android.d.ts.map +1 -0
- package/lib/Radio/RadioTokens.android.js +51 -0
- package/lib/Radio/RadioTokens.android.js.map +1 -0
- package/lib/Radio/RadioTokens.d.ts +5 -0
- package/lib/Radio/RadioTokens.d.ts.map +1 -0
- package/lib/Radio/RadioTokens.ios.d.ts +5 -0
- package/lib/Radio/RadioTokens.ios.d.ts.map +1 -0
- package/lib/Radio/RadioTokens.ios.js +52 -0
- package/lib/Radio/RadioTokens.ios.js.map +1 -0
- package/lib/Radio/RadioTokens.js +86 -0
- package/lib/Radio/RadioTokens.js.map +1 -0
- package/lib/Radio/RadioTokens.win32.d.ts +5 -0
- package/lib/Radio/RadioTokens.win32.d.ts.map +1 -0
- package/lib/Radio/RadioTokens.win32.js +100 -0
- package/lib/Radio/RadioTokens.win32.js.map +1 -0
- package/lib/Radio/__tests__/RadioExperimental.test.d.ts +2 -0
- package/lib/Radio/__tests__/RadioExperimental.test.d.ts.map +1 -0
- package/lib/Radio/__tests__/RadioExperimental.test.js +22 -0
- package/lib/Radio/__tests__/RadioExperimental.test.js.map +1 -0
- package/lib/Radio/useRadio.d.ts +3 -0
- package/lib/Radio/useRadio.d.ts.map +1 -0
- package/lib/Radio/useRadio.js +55 -0
- package/lib/Radio/useRadio.js.map +1 -0
- package/lib/Radio/useRadio.win32.d.ts +3 -0
- package/lib/Radio/useRadio.win32.d.ts.map +1 -0
- package/lib/Radio/useRadio.win32.js +109 -0
- package/lib/Radio/useRadio.win32.js.map +1 -0
- package/lib/RadioGroup/RadioGroup.d.ts +12 -0
- package/lib/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroup.js +58 -0
- package/lib/RadioGroup/RadioGroup.js.map +1 -0
- package/lib/RadioGroup/RadioGroup.styling.d.ts +5 -0
- package/lib/RadioGroup/RadioGroup.styling.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroup.styling.js +47 -0
- package/lib/RadioGroup/RadioGroup.styling.js.map +1 -0
- package/lib/RadioGroup/RadioGroup.types.d.ts +130 -0
- package/lib/RadioGroup/RadioGroup.types.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroup.types.js.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.android.d.ts +3 -0
- package/lib/RadioGroup/RadioGroupTokens.android.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.android.js +3 -0
- package/lib/RadioGroup/RadioGroupTokens.android.js.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.d.ts +5 -0
- package/lib/RadioGroup/RadioGroupTokens.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.ios.d.ts +2 -0
- package/lib/RadioGroup/RadioGroupTokens.ios.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.ios.js +2 -0
- package/lib/RadioGroup/RadioGroupTokens.ios.js.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.js +17 -0
- package/lib/RadioGroup/RadioGroupTokens.js.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts +5 -0
- package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts.map +1 -0
- package/lib/RadioGroup/RadioGroupTokens.mobile.js +18 -0
- package/lib/RadioGroup/RadioGroupTokens.mobile.js.map +1 -0
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +2 -0
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts.map +1 -0
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +63 -0
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +1 -0
- package/lib/RadioGroup/radioGroupContext.d.ts +11 -0
- package/lib/RadioGroup/radioGroupContext.d.ts.map +1 -0
- package/lib/RadioGroup/radioGroupContext.js +22 -0
- package/lib/RadioGroup/radioGroupContext.js.map +1 -0
- package/lib/RadioGroup/useRadioGroup.d.ts +3 -0
- package/lib/RadioGroup/useRadioGroup.d.ts.map +1 -0
- package/lib/RadioGroup/useRadioGroup.js +63 -0
- package/lib/RadioGroup/useRadioGroup.js.map +1 -0
- package/lib/RadioGroup/useRadioGroupContextValue.d.ts +4 -0
- package/lib/RadioGroup/useRadioGroupContextValue.d.ts.map +1 -0
- package/lib/RadioGroup/useRadioGroupContextValue.js +5 -0
- package/lib/RadioGroup/useRadioGroupContextValue.js.map +1 -0
- package/lib/index.d.ts +14 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +12 -4
- package/lib/index.js.map +1 -1
- package/lib/legacy/RadioButton.d.ts.map +1 -0
- package/lib/{RadioButton.js → legacy/RadioButton.js} +1 -22
- package/lib/legacy/RadioButton.js.map +1 -0
- package/lib/legacy/RadioButton.macos.d.ts.map +1 -0
- package/lib/legacy/RadioButton.macos.js.map +1 -0
- package/lib/legacy/RadioButton.settings.d.ts.map +1 -0
- package/lib/legacy/RadioButton.settings.js.map +1 -0
- package/lib/legacy/RadioButton.types.d.ts.map +1 -0
- package/lib/legacy/RadioButton.types.js.map +1 -0
- package/lib/legacy/RadioGroup.d.ts.map +1 -0
- package/lib/{RadioGroup.js → legacy/RadioGroup.js} +1 -22
- package/lib/legacy/RadioGroup.js.map +1 -0
- package/lib/legacy/RadioGroup.settings.d.ts.map +1 -0
- package/lib/legacy/RadioGroup.settings.js.map +1 -0
- package/lib/legacy/RadioGroup.types.d.ts.map +1 -0
- package/lib/legacy/RadioGroup.types.js +2 -0
- package/lib/legacy/RadioGroup.types.js.map +1 -0
- package/lib/legacy/__tests__/RadioButton.test.d.ts.map +1 -0
- package/lib/{RadioButton.test.js → legacy/__tests__/RadioButton.test.js} +1 -1
- package/lib/legacy/__tests__/RadioButton.test.js.map +1 -0
- package/lib/legacy/__tests__/RadioButtonGroup.test.d.ts.map +1 -0
- package/lib/{RadioButtonGroup.test.js → legacy/__tests__/RadioButtonGroup.test.js} +1 -1
- package/lib/legacy/__tests__/RadioButtonGroup.test.js.map +1 -0
- package/lib-commonjs/Radio/Radio.d.ts +13 -0
- package/lib-commonjs/Radio/Radio.d.ts.map +1 -0
- package/lib-commonjs/Radio/Radio.js +52 -0
- package/lib-commonjs/Radio/Radio.js.map +1 -0
- package/lib-commonjs/Radio/Radio.styling.d.ts +5 -0
- package/lib-commonjs/Radio/Radio.styling.d.ts.map +1 -0
- package/lib-commonjs/Radio/Radio.styling.js +81 -0
- package/lib-commonjs/Radio/Radio.styling.js.map +1 -0
- package/lib-commonjs/Radio/Radio.types.d.ts +185 -0
- package/lib-commonjs/Radio/Radio.types.d.ts.map +1 -0
- package/lib-commonjs/Radio/Radio.types.js +5 -0
- package/lib-commonjs/Radio/Radio.types.js.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.android.d.ts +5 -0
- package/lib-commonjs/Radio/RadioTokens.android.d.ts.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.android.js +55 -0
- package/lib-commonjs/Radio/RadioTokens.android.js.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.d.ts +5 -0
- package/lib-commonjs/Radio/RadioTokens.d.ts.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.ios.d.ts +5 -0
- package/lib-commonjs/Radio/RadioTokens.ios.d.ts.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.ios.js +56 -0
- package/lib-commonjs/Radio/RadioTokens.ios.js.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.js +90 -0
- package/lib-commonjs/Radio/RadioTokens.js.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.win32.d.ts +5 -0
- package/lib-commonjs/Radio/RadioTokens.win32.d.ts.map +1 -0
- package/lib-commonjs/Radio/RadioTokens.win32.js +104 -0
- package/lib-commonjs/Radio/RadioTokens.win32.js.map +1 -0
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +2 -0
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts.map +1 -0
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +25 -0
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js.map +1 -0
- package/lib-commonjs/Radio/useRadio.d.ts +3 -0
- package/lib-commonjs/Radio/useRadio.d.ts.map +1 -0
- package/lib-commonjs/Radio/useRadio.js +59 -0
- package/lib-commonjs/Radio/useRadio.js.map +1 -0
- package/lib-commonjs/Radio/useRadio.win32.d.ts +3 -0
- package/lib-commonjs/Radio/useRadio.win32.d.ts.map +1 -0
- package/lib-commonjs/Radio/useRadio.win32.js +113 -0
- package/lib-commonjs/Radio/useRadio.win32.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.d.ts +12 -0
- package/lib-commonjs/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.js +62 -0
- package/lib-commonjs/RadioGroup/RadioGroup.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +5 -0
- package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.styling.js +50 -0
- package/lib-commonjs/RadioGroup/RadioGroup.styling.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +130 -0
- package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroup.types.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +3 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +6 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +5 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +2 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +6 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.js +21 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +5 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +22 -0
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +1 -0
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +2 -0
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +66 -0
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +1 -0
- package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +11 -0
- package/lib-commonjs/RadioGroup/radioGroupContext.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/radioGroupContext.js +27 -0
- package/lib-commonjs/RadioGroup/radioGroupContext.js.map +1 -0
- package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +3 -0
- package/lib-commonjs/RadioGroup/useRadioGroup.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/useRadioGroup.js +67 -0
- package/lib-commonjs/RadioGroup/useRadioGroup.js.map +1 -0
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +4 -0
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts.map +1 -0
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +9 -0
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js.map +1 -0
- package/lib-commonjs/index.d.ts +14 -6
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +27 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/legacy/RadioButton.d.ts.map +1 -0
- package/lib-commonjs/{RadioButton.js → legacy/RadioButton.js} +6 -50
- package/lib-commonjs/legacy/RadioButton.js.map +1 -0
- package/lib-commonjs/legacy/RadioButton.macos.d.ts.map +1 -0
- package/lib-commonjs/{RadioButton.macos.js → legacy/RadioButton.macos.js} +2 -24
- package/lib-commonjs/legacy/RadioButton.macos.js.map +1 -0
- package/lib-commonjs/legacy/RadioButton.settings.d.ts.map +1 -0
- package/lib-commonjs/legacy/RadioButton.settings.js.map +1 -0
- package/lib-commonjs/legacy/RadioButton.types.d.ts.map +1 -0
- package/lib-commonjs/legacy/RadioButton.types.js.map +1 -0
- package/lib-commonjs/legacy/RadioGroup.d.ts.map +1 -0
- package/lib-commonjs/{RadioGroup.js → legacy/RadioGroup.js} +4 -48
- package/lib-commonjs/legacy/RadioGroup.js.map +1 -0
- package/lib-commonjs/legacy/RadioGroup.settings.d.ts.map +1 -0
- package/lib-commonjs/legacy/RadioGroup.settings.js.map +1 -0
- package/lib-commonjs/legacy/RadioGroup.types.d.ts.map +1 -0
- package/lib-commonjs/legacy/RadioGroup.types.js +5 -0
- package/lib-commonjs/legacy/RadioGroup.types.js.map +1 -0
- package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts.map +1 -0
- package/lib-commonjs/legacy/__tests__/RadioButton.test.js +13 -0
- package/lib-commonjs/legacy/__tests__/RadioButton.test.js.map +1 -0
- package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts.map +1 -0
- package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +23 -0
- package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js.map +1 -0
- package/package.json +6 -2
- package/src/Radio/Radio.styling.ts +112 -0
- package/src/Radio/Radio.tsx +77 -0
- package/src/Radio/Radio.types.ts +233 -0
- package/src/Radio/RadioTokens.android.ts +59 -0
- package/src/Radio/RadioTokens.ios.ts +61 -0
- package/src/Radio/RadioTokens.ts +98 -0
- package/src/Radio/RadioTokens.win32.ts +112 -0
- package/src/Radio/__tests__/RadioExperimental.test.tsx +27 -0
- package/src/Radio/__tests__/__snapshots__/RadioExperimental.test.tsx.snap +246 -0
- package/src/Radio/useRadio.ts +121 -0
- package/src/Radio/useRadio.win32.ts +185 -0
- package/src/RadioGroup/RadioGroup.styling.ts +62 -0
- package/src/RadioGroup/RadioGroup.tsx +84 -0
- package/src/RadioGroup/RadioGroup.types.ts +154 -0
- package/src/RadioGroup/RadioGroupTokens.android.ts +3 -0
- package/src/RadioGroup/RadioGroupTokens.ios.ts +1 -0
- package/src/RadioGroup/RadioGroupTokens.mobile.ts +21 -0
- package/src/RadioGroup/RadioGroupTokens.ts +20 -0
- package/src/RadioGroup/__tests__/RadioGroupExperimental.test.tsx +91 -0
- package/src/RadioGroup/__tests__/__snapshots__/RadioGroupExperimental.test.tsx.snap +1793 -0
- package/src/RadioGroup/radioGroupContext.ts +30 -0
- package/src/RadioGroup/useRadioGroup.ts +123 -0
- package/src/RadioGroup/useRadioGroupContextValue.ts +6 -0
- package/src/index.ts +28 -6
- package/src/{RadioButton.test.tsx → legacy/__tests__/RadioButton.test.tsx} +1 -1
- package/src/{RadioButtonGroup.test.tsx → legacy/__tests__/RadioButtonGroup.test.tsx} +1 -1
- package/tsconfig.json +1 -0
- package/lib/RadioButton.d.ts.map +0 -1
- package/lib/RadioButton.js.map +0 -1
- package/lib/RadioButton.macos.d.ts.map +0 -1
- package/lib/RadioButton.macos.js.map +0 -1
- package/lib/RadioButton.settings.d.ts.map +0 -1
- package/lib/RadioButton.settings.js.map +0 -1
- package/lib/RadioButton.test.d.ts.map +0 -1
- package/lib/RadioButton.test.js.map +0 -1
- package/lib/RadioButton.types.d.ts.map +0 -1
- package/lib/RadioButton.types.js.map +0 -1
- package/lib/RadioButtonGroup.test.d.ts.map +0 -1
- package/lib/RadioButtonGroup.test.js.map +0 -1
- package/lib/RadioGroup.d.ts.map +0 -1
- package/lib/RadioGroup.js.map +0 -1
- package/lib/RadioGroup.settings.d.ts.map +0 -1
- package/lib/RadioGroup.settings.js.map +0 -1
- package/lib/RadioGroup.types.d.ts.map +0 -1
- package/lib/RadioGroup.types.js.map +0 -1
- package/lib-commonjs/RadioButton.d.ts.map +0 -1
- package/lib-commonjs/RadioButton.js.map +0 -1
- package/lib-commonjs/RadioButton.macos.d.ts.map +0 -1
- package/lib-commonjs/RadioButton.macos.js.map +0 -1
- package/lib-commonjs/RadioButton.settings.d.ts.map +0 -1
- package/lib-commonjs/RadioButton.settings.js.map +0 -1
- package/lib-commonjs/RadioButton.test.d.ts.map +0 -1
- package/lib-commonjs/RadioButton.test.js +0 -35
- package/lib-commonjs/RadioButton.test.js.map +0 -1
- package/lib-commonjs/RadioButton.types.d.ts.map +0 -1
- package/lib-commonjs/RadioButton.types.js.map +0 -1
- package/lib-commonjs/RadioButtonGroup.test.d.ts.map +0 -1
- package/lib-commonjs/RadioButtonGroup.test.js +0 -45
- package/lib-commonjs/RadioButtonGroup.test.js.map +0 -1
- package/lib-commonjs/RadioGroup.d.ts.map +0 -1
- package/lib-commonjs/RadioGroup.js.map +0 -1
- package/lib-commonjs/RadioGroup.settings.d.ts.map +0 -1
- package/lib-commonjs/RadioGroup.settings.js.map +0 -1
- package/lib-commonjs/RadioGroup.types.d.ts.map +0 -1
- package/lib-commonjs/RadioGroup.types.js.map +0 -1
- /package/lib/{RadioGroup.types.js → RadioGroup/RadioGroup.types.js} +0 -0
- /package/lib/{RadioButton.d.ts → legacy/RadioButton.d.ts} +0 -0
- /package/lib/{RadioButton.macos.d.ts → legacy/RadioButton.macos.d.ts} +0 -0
- /package/lib/{RadioButton.macos.js → legacy/RadioButton.macos.js} +0 -0
- /package/lib/{RadioButton.settings.d.ts → legacy/RadioButton.settings.d.ts} +0 -0
- /package/lib/{RadioButton.settings.js → legacy/RadioButton.settings.js} +0 -0
- /package/lib/{RadioButton.types.d.ts → legacy/RadioButton.types.d.ts} +0 -0
- /package/lib/{RadioButton.types.js → legacy/RadioButton.types.js} +0 -0
- /package/lib/{RadioGroup.d.ts → legacy/RadioGroup.d.ts} +0 -0
- /package/lib/{RadioGroup.settings.d.ts → legacy/RadioGroup.settings.d.ts} +0 -0
- /package/lib/{RadioGroup.settings.js → legacy/RadioGroup.settings.js} +0 -0
- /package/lib/{RadioGroup.types.d.ts → legacy/RadioGroup.types.d.ts} +0 -0
- /package/lib/{RadioButton.test.d.ts → legacy/__tests__/RadioButton.test.d.ts} +0 -0
- /package/lib/{RadioButtonGroup.test.d.ts → legacy/__tests__/RadioButtonGroup.test.d.ts} +0 -0
- /package/lib-commonjs/{RadioGroup.types.js → RadioGroup/RadioGroup.types.js} +0 -0
- /package/lib-commonjs/{RadioButton.d.ts → legacy/RadioButton.d.ts} +0 -0
- /package/lib-commonjs/{RadioButton.macos.d.ts → legacy/RadioButton.macos.d.ts} +0 -0
- /package/lib-commonjs/{RadioButton.settings.d.ts → legacy/RadioButton.settings.d.ts} +0 -0
- /package/lib-commonjs/{RadioButton.settings.js → legacy/RadioButton.settings.js} +0 -0
- /package/lib-commonjs/{RadioButton.types.d.ts → legacy/RadioButton.types.d.ts} +0 -0
- /package/lib-commonjs/{RadioButton.types.js → legacy/RadioButton.types.js} +0 -0
- /package/lib-commonjs/{RadioGroup.d.ts → legacy/RadioGroup.d.ts} +0 -0
- /package/lib-commonjs/{RadioGroup.settings.d.ts → legacy/RadioGroup.settings.d.ts} +0 -0
- /package/lib-commonjs/{RadioGroup.settings.js → legacy/RadioGroup.settings.js} +0 -0
- /package/lib-commonjs/{RadioGroup.types.d.ts → legacy/RadioGroup.types.d.ts} +0 -0
- /package/lib-commonjs/{RadioButton.test.d.ts → legacy/__tests__/RadioButton.test.d.ts} +0 -0
- /package/lib-commonjs/{RadioButtonGroup.test.d.ts → legacy/__tests__/RadioButtonGroup.test.d.ts} +0 -0
- /package/src/{RadioButton.macos.tsx → legacy/RadioButton.macos.tsx} +0 -0
- /package/src/{RadioButton.settings.ts → legacy/RadioButton.settings.ts} +0 -0
- /package/src/{RadioButton.tsx → legacy/RadioButton.tsx} +0 -0
- /package/src/{RadioButton.types.ts → legacy/RadioButton.types.ts} +0 -0
- /package/src/{RadioGroup.settings.ts → legacy/RadioGroup.settings.ts} +0 -0
- /package/src/{RadioGroup.tsx → legacy/RadioGroup.tsx} +0 -0
- /package/src/{RadioGroup.types.ts → legacy/RadioGroup.types.ts} +0 -0
- /package/src/{__snapshots__ → legacy/__tests__/__snapshots__}/RadioButton.test.tsx.snap +0 -0
- /package/src/{__snapshots__ → legacy/__tests__/__snapshots__}/RadioButtonGroup.test.tsx.snap +0 -0
|
@@ -1,53 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
3
|
exports.RadioGroup = exports.RadioGroupContext = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
49
5
|
/** @jsx withSlots */
|
|
50
|
-
var React = __importStar(require("react"));
|
|
6
|
+
var React = tslib_1.__importStar(require("react"));
|
|
51
7
|
var react_native_1 = require("react-native");
|
|
52
8
|
var focus_zone_1 = require("@fluentui-react-native/focus-zone");
|
|
53
9
|
var interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
|
|
@@ -72,7 +28,7 @@ exports.RadioGroup = (0, foundation_compose_1.compose)({
|
|
|
72
28
|
displayName: RadioGroup_types_1.radioGroupName,
|
|
73
29
|
usePrepareProps: function (userProps, useStyling) {
|
|
74
30
|
var _a;
|
|
75
|
-
var label = userProps.label, ariaLabel = userProps.ariaLabel, accessibilityLabel = userProps.accessibilityLabel, selectedKey = userProps.selectedKey, defaultSelectedKey = userProps.defaultSelectedKey, rest = __rest(userProps, ["label", "ariaLabel", "accessibilityLabel", "selectedKey", "defaultSelectedKey"]);
|
|
31
|
+
var label = userProps.label, ariaLabel = userProps.ariaLabel, accessibilityLabel = userProps.accessibilityLabel, selectedKey = userProps.selectedKey, defaultSelectedKey = userProps.defaultSelectedKey, rest = tslib_1.__rest(userProps, ["label", "ariaLabel", "accessibilityLabel", "selectedKey", "defaultSelectedKey"]);
|
|
76
32
|
// This hook updates the Selected Button and calls the customer's onClick function. This gets called after a button is pressed.
|
|
77
33
|
var data = (0, interactive_hooks_1.useSelectedKey)(selectedKey || defaultSelectedKey || null, userProps.onChange);
|
|
78
34
|
var _b = React.useState(React.useRef(null)), selectedButtonRef = _b[0], setSelectedButtonRef = _b[1];
|
|
@@ -88,7 +44,7 @@ exports.RadioGroup = (0, foundation_compose_1.compose)({
|
|
|
88
44
|
};
|
|
89
45
|
var styleProps = useStyling(userProps, function (override) { return state[override] || userProps[override]; });
|
|
90
46
|
var slotProps = (0, foundation_settings_1.mergeSettings)(styleProps, {
|
|
91
|
-
root: __assign({ accessibilityLabel: (_a = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : ariaLabel) !== null && _a !== void 0 ? _a : label, accessibilityRole: 'radiogroup' }, rest),
|
|
47
|
+
root: tslib_1.__assign({ accessibilityLabel: (_a = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : ariaLabel) !== null && _a !== void 0 ? _a : label, accessibilityRole: 'radiogroup' }, rest),
|
|
92
48
|
label: { children: label },
|
|
93
49
|
container: { isCircularNavigation: true, defaultTabbableElement: selectedButtonRef },
|
|
94
50
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.settings.d.ts","sourceRoot":"","sources":["../../src/legacy/RadioGroup.settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAsBtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.settings.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.settings.ts"],"names":[],"mappings":";;;AAGA,uDAAoD;AAEvC,QAAA,QAAQ,GAAsC;IACzD;QACE,MAAM,EAAE;YACN,KAAK,EAAE,cAAc;SACtB;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,IAAI;YAChB,iBAAiB,EAAE,OAAO;YAC1B,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,YAAY;gBACxB,aAAa,EAAE,QAAQ;aACxB;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE,KAAK;aAClB;SACF;KACF;IACD,iCAAc;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.types.d.ts","sourceRoot":"","sources":["../../src/legacy/RadioGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAE9D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB,EAAE,UAAU;CAAG;AAEhF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAC1C,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;AAExF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,gBAAgB,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.types.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.types.ts"],"names":[],"mappings":";;;AAQa,QAAA,cAAc,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.test.d.ts","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var React = tslib_1.__importStar(require("react"));
|
|
5
|
+
var renderer = tslib_1.__importStar(require("react-test-renderer"));
|
|
6
|
+
var RadioButton_1 = require("../RadioButton");
|
|
7
|
+
describe('RadioButton component tests', function () {
|
|
8
|
+
it('RadioButton default', function () {
|
|
9
|
+
var tree = renderer.create(React.createElement(RadioButton_1.RadioButton, { buttonKey: "key1", content: "Default Button" })).toJSON();
|
|
10
|
+
expect(tree).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=RadioButton.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAE/B,oEAAgD;AAEhD,8CAA6C;AAE7C,QAAQ,CAAC,6BAA6B,EAAE;IACtC,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,yBAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QACjG,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.test.d.ts","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButtonGroup.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var React = tslib_1.__importStar(require("react"));
|
|
5
|
+
var react_native_1 = require("react-native");
|
|
6
|
+
var renderer = tslib_1.__importStar(require("react-test-renderer"));
|
|
7
|
+
var __1 = require("../..");
|
|
8
|
+
describe('RadioButton component tests', function () {
|
|
9
|
+
it('RadioButton default', function () {
|
|
10
|
+
var tree = renderer.create(React.createElement(__1.RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2" },
|
|
11
|
+
React.createElement(__1.RadioButton, { buttonKey: "key1", content: "RadioButton1" }),
|
|
12
|
+
React.createElement(__1.RadioButton, { buttonKey: "key2", content: "RadioButton2" })));
|
|
13
|
+
expect(tree).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
it('RadioButton not direct child of radio group', function () {
|
|
16
|
+
var tree = renderer.create(React.createElement(__1.RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2" },
|
|
17
|
+
React.createElement(react_native_1.View, null,
|
|
18
|
+
React.createElement(__1.RadioButton, { buttonKey: "key1", content: "RadioButton1", accessibilityPositionInSet: 1, accessibilitySetSize: 2 }),
|
|
19
|
+
React.createElement(__1.RadioButton, { buttonKey: "key2", content: "RadioButton2", accessibilityPositionInSet: 2, accessibilitySetSize: 2 }))));
|
|
20
|
+
expect(tree).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=RadioButtonGroup.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButtonGroup.test.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,6CAAoC;AAEpC,oEAAgD;AAEhD,2BAAgD;AAEhD,QAAQ,CAAC,6BAA6B,EAAE;IACtC,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAC1B,oBAAC,cAAU,IAAC,KAAK,EAAC,yBAAyB,EAAC,kBAAkB,EAAC,MAAM;YACnE,oBAAC,eAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,cAAc,GAAG;YACvD,oBAAC,eAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,cAAc,GAAG,CAC5C,CACd,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE;QAChD,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAC1B,oBAAC,cAAU,IAAC,KAAK,EAAC,yBAAyB,EAAC,kBAAkB,EAAC,MAAM;YACnE,oBAAC,mBAAI;gBACH,oBAAC,eAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,cAAc,EAAC,0BAA0B,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC,GAAI;gBAC/G,oBAAC,eAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,cAAc,EAAC,0BAA0B,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC,GAAI,CAC1G,CACI,CACd,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/radio-group",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.47",
|
|
4
4
|
"description": "A cross-platform Radio Group component using the Fluent Design System",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -26,12 +26,16 @@
|
|
|
26
26
|
"@fluentui-react-native/adapters": ">=0.10.2 <1.0.0",
|
|
27
27
|
"@fluentui-react-native/component-cache": "^1.4.4",
|
|
28
28
|
"@fluentui-react-native/focus-zone": ">=0.11.42 <1.0.0",
|
|
29
|
+
"@fluentui-react-native/framework": "0.9.9",
|
|
29
30
|
"@fluentui-react-native/interactive-hooks": ">=0.22.30 <1.0.0",
|
|
30
31
|
"@fluentui-react-native/pressable": ">=0.9.69 <1.0.0",
|
|
31
32
|
"@fluentui-react-native/text": ">=0.19.32 <1.0.0",
|
|
33
|
+
"@fluentui-react-native/theme-tokens": ">=0.24.6 <1.0.0",
|
|
32
34
|
"@fluentui-react-native/tokens": ">=0.20.15 <1.0.0",
|
|
35
|
+
"@fluentui-react-native/use-styling": ">=0.9.4 <1.0.0",
|
|
33
36
|
"@uifabricshared/foundation-composable": ">=0.11.3 <1.0.0",
|
|
34
|
-
"@uifabricshared/foundation-settings": ">=0.12.3 <1.0.0"
|
|
37
|
+
"@uifabricshared/foundation-settings": ">=0.12.3 <1.0.0",
|
|
38
|
+
"tslib": "^2.3.1"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@fluentui-react-native/eslint-config-rules": "^0.1.1",
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Theme, UseStylingOptions } from '@fluentui-react-native/framework';
|
|
2
|
+
import { buildProps } from '@fluentui-react-native/framework';
|
|
3
|
+
import { fontStyles, borderStyles } from '@fluentui-react-native/tokens';
|
|
4
|
+
|
|
5
|
+
import type { RadioTokens, RadioSlotProps, RadioProps } from './Radio.types';
|
|
6
|
+
import { radioName } from './Radio.types';
|
|
7
|
+
import { defaultRadioTokens } from './RadioTokens';
|
|
8
|
+
|
|
9
|
+
export const radioStates: (keyof RadioTokens)[] = ['labelPositionBelow', 'focused', 'hovered', 'pressed', 'selected', 'disabled'];
|
|
10
|
+
|
|
11
|
+
export const stylingSettings: UseStylingOptions<RadioProps, RadioSlotProps, RadioTokens> = {
|
|
12
|
+
tokens: [defaultRadioTokens, radioName],
|
|
13
|
+
states: radioStates,
|
|
14
|
+
slotProps: {
|
|
15
|
+
root: buildProps(
|
|
16
|
+
(tokens: RadioTokens) => ({
|
|
17
|
+
style: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: tokens.alignItems,
|
|
20
|
+
flexDirection: tokens.flexDirection,
|
|
21
|
+
paddingHorizontal: tokens.rootHorizontalPadding,
|
|
22
|
+
paddingVertical: tokens.rootVerticalPadding,
|
|
23
|
+
},
|
|
24
|
+
android_ripple: { color: tokens.rippleColor },
|
|
25
|
+
}),
|
|
26
|
+
['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems'],
|
|
27
|
+
),
|
|
28
|
+
button: buildProps(
|
|
29
|
+
(tokens: RadioTokens) => ({
|
|
30
|
+
style: {
|
|
31
|
+
backgroundColor: tokens.radioOuterCircleBackground,
|
|
32
|
+
width: tokens.radioOuterCircleSize,
|
|
33
|
+
height: tokens.radioOuterCircleSize,
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
borderWidth: tokens.radioBorderWidth,
|
|
37
|
+
borderStyle: tokens.radioBorderStyle,
|
|
38
|
+
borderRadius: tokens.radioOuterCircleSize / 2,
|
|
39
|
+
borderColor: tokens.radioBorder,
|
|
40
|
+
marginTop: tokens.marginTop,
|
|
41
|
+
marginRight: tokens.marginRight,
|
|
42
|
+
marginBottom: tokens.marginBottom,
|
|
43
|
+
marginLeft: tokens.marginLeft,
|
|
44
|
+
},
|
|
45
|
+
android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
|
|
46
|
+
}),
|
|
47
|
+
[
|
|
48
|
+
'radioOuterCircleBackground',
|
|
49
|
+
'radioBorderWidth',
|
|
50
|
+
'radioBorderStyle',
|
|
51
|
+
'radioOuterCircleSize',
|
|
52
|
+
'rippleColor',
|
|
53
|
+
'rippleRadius',
|
|
54
|
+
'radioBorder',
|
|
55
|
+
'marginTop',
|
|
56
|
+
'marginRight',
|
|
57
|
+
'marginBottom',
|
|
58
|
+
'marginLeft',
|
|
59
|
+
],
|
|
60
|
+
),
|
|
61
|
+
innerCircle: buildProps(
|
|
62
|
+
(tokens: RadioTokens) => ({
|
|
63
|
+
style: {
|
|
64
|
+
opacity: tokens.radioVisibility,
|
|
65
|
+
borderRadius: tokens.radioInnerCircleSize / 2,
|
|
66
|
+
height: tokens.radioInnerCircleSize,
|
|
67
|
+
width: tokens.radioInnerCircleSize,
|
|
68
|
+
backgroundColor: tokens.radioFill,
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
['radioInnerCircleSize', 'radioVisibility', 'radioFill'],
|
|
72
|
+
),
|
|
73
|
+
labelContent: buildProps(
|
|
74
|
+
(tokens: RadioTokens, theme: Theme) => ({
|
|
75
|
+
style: {
|
|
76
|
+
alignItems: tokens.labelAlignItems,
|
|
77
|
+
flexDirection: 'column',
|
|
78
|
+
marginRight: tokens.labelMarginRight,
|
|
79
|
+
marginLeft: tokens.labelMarginLeft,
|
|
80
|
+
padding: tokens.labelPadding,
|
|
81
|
+
paddingRight: 0,
|
|
82
|
+
...borderStyles.from(tokens, theme),
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...borderStyles.keys],
|
|
86
|
+
),
|
|
87
|
+
label: buildProps(
|
|
88
|
+
(tokens: RadioTokens, theme: Theme) => ({
|
|
89
|
+
variant: tokens.variant,
|
|
90
|
+
style: {
|
|
91
|
+
marginVertical: tokens.labelMarginVertical,
|
|
92
|
+
marginHorizontal: 2,
|
|
93
|
+
color: tokens.color,
|
|
94
|
+
...fontStyles.from(tokens, theme),
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
['variant', 'labelMarginVertical', 'color', ...fontStyles.keys],
|
|
98
|
+
),
|
|
99
|
+
subtext: buildProps(
|
|
100
|
+
(tokens: RadioTokens) => ({
|
|
101
|
+
variant: tokens.subtextVariant,
|
|
102
|
+
style: {
|
|
103
|
+
marginTop: tokens.subtextMarginTop,
|
|
104
|
+
marginBottom: tokens.subtextMarginBottom,
|
|
105
|
+
marginHorizontal: 2,
|
|
106
|
+
color: tokens.color,
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant'],
|
|
110
|
+
),
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** @jsx withSlots */
|
|
2
|
+
import { Platform, Pressable, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { UseSlots } from '@fluentui-react-native/framework';
|
|
5
|
+
import { compose, mergeProps, withSlots } from '@fluentui-react-native/framework';
|
|
6
|
+
import type { PressableState } from '@fluentui-react-native/interactive-hooks';
|
|
7
|
+
import { TextV1 as Text } from '@fluentui-react-native/text';
|
|
8
|
+
|
|
9
|
+
import { stylingSettings } from './Radio.styling';
|
|
10
|
+
import type { RadioType, RadioProps } from './Radio.types';
|
|
11
|
+
import { radioName } from './Radio.types';
|
|
12
|
+
import { useRadio } from './useRadio';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A function which determines if a set of styles should be applied to the component given the current state and props of the Radio.
|
|
16
|
+
*
|
|
17
|
+
* @param layer The name of the state that is being checked for
|
|
18
|
+
* @param state The current state of the Radio
|
|
19
|
+
* @param userProps The props that were passed into the Radio
|
|
20
|
+
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
21
|
+
*/
|
|
22
|
+
export const radioLookup = (layer: string, state: PressableState, userProps: RadioProps): boolean => {
|
|
23
|
+
return (
|
|
24
|
+
state[layer] ||
|
|
25
|
+
userProps[layer] ||
|
|
26
|
+
(!(Platform.OS === ('win32' as any) || Platform.OS === 'android') &&
|
|
27
|
+
layer === 'labelPositionBelow' &&
|
|
28
|
+
userProps['labelPosition'] === 'below')
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Radio = compose<RadioType>({
|
|
33
|
+
displayName: radioName,
|
|
34
|
+
...stylingSettings,
|
|
35
|
+
slots: {
|
|
36
|
+
root: Pressable,
|
|
37
|
+
button: Pressable,
|
|
38
|
+
innerCircle: View,
|
|
39
|
+
labelContent: View,
|
|
40
|
+
label: Text,
|
|
41
|
+
subtext: Text,
|
|
42
|
+
},
|
|
43
|
+
useRender: (userProps: RadioProps, useSlots: UseSlots<RadioType>) => {
|
|
44
|
+
const radio = useRadio(userProps);
|
|
45
|
+
const Slots = useSlots(userProps, (layer: string) => radioLookup(layer, radio.state, radio.props));
|
|
46
|
+
|
|
47
|
+
// now return the handler for finishing render
|
|
48
|
+
return (final: RadioProps) => {
|
|
49
|
+
const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
|
|
50
|
+
const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
|
|
51
|
+
const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';
|
|
52
|
+
|
|
53
|
+
const labelComponent = (
|
|
54
|
+
<Slots.labelContent>
|
|
55
|
+
<Slots.label>{label}</Slots.label>
|
|
56
|
+
{!!subtext && <Slots.subtext>{subtext}</Slots.subtext>}
|
|
57
|
+
</Slots.labelContent>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Slots.root {...mergedProps} {...(isMobile && { accessible: !disabled, focusable: !disabled })}>
|
|
62
|
+
<Slots.button
|
|
63
|
+
accessible={false}
|
|
64
|
+
onPress={onPress}
|
|
65
|
+
onPressIn={onPressIn}
|
|
66
|
+
onPressOut={onPressOut}
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
focusable={false}
|
|
69
|
+
>
|
|
70
|
+
<Slots.innerCircle />
|
|
71
|
+
</Slots.button>
|
|
72
|
+
{labelComponent}
|
|
73
|
+
</Slots.root>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { ColorValue, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
4
|
+
import type { Variant } from '@fluentui-react-native/framework';
|
|
5
|
+
import type { IFocusable, PressablePropsExtended, PressableState } from '@fluentui-react-native/interactive-hooks';
|
|
6
|
+
import type { TextProps } from '@fluentui-react-native/text';
|
|
7
|
+
import type {
|
|
8
|
+
FontTokens,
|
|
9
|
+
IForegroundColorTokens,
|
|
10
|
+
IBackgroundColorTokens,
|
|
11
|
+
IBorderTokens,
|
|
12
|
+
IColorTokens,
|
|
13
|
+
} from '@fluentui-react-native/tokens';
|
|
14
|
+
|
|
15
|
+
export const radioName = 'Radio';
|
|
16
|
+
|
|
17
|
+
export interface RadioTokens extends FontTokens, IColorTokens, IForegroundColorTokens, IBackgroundColorTokens, IBorderTokens {
|
|
18
|
+
/**
|
|
19
|
+
* Horizontal padding of the root view
|
|
20
|
+
*/
|
|
21
|
+
rootHorizontalPadding?: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Vertical padding of the root view
|
|
25
|
+
*/
|
|
26
|
+
rootVerticalPadding?: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Indicator border color
|
|
30
|
+
*/
|
|
31
|
+
radioBorder?: ColorValue;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Indicator border style
|
|
35
|
+
*/
|
|
36
|
+
radioBorderStyle?: ViewStyle['borderStyle'];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Inner circle color when selected
|
|
40
|
+
*/
|
|
41
|
+
radioFill?: ColorValue;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Visibility of the radio inner circle from 0 to 1
|
|
45
|
+
*/
|
|
46
|
+
radioVisibility?: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Diameter size of the outer indicator
|
|
50
|
+
*/
|
|
51
|
+
radioOuterCircleSize?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Diameter size of the inner circle indicator
|
|
55
|
+
*/
|
|
56
|
+
radioInnerCircleSize?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Border width of Radio
|
|
60
|
+
*/
|
|
61
|
+
radioBorderWidth?: number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Background color of outer circle
|
|
65
|
+
*/
|
|
66
|
+
radioOuterCircleBackground?: ColorValue;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The flex direction of the root
|
|
70
|
+
*/
|
|
71
|
+
flexDirection?: ViewStyle['flexDirection'];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Root item alignment
|
|
75
|
+
*/
|
|
76
|
+
alignItems?: ViewStyle['alignItems'];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The top margin
|
|
80
|
+
*/
|
|
81
|
+
marginTop?: ViewStyle['marginTop'];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The right margin
|
|
85
|
+
*/
|
|
86
|
+
marginRight?: ViewStyle['marginRight'];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The bottom margin
|
|
90
|
+
*/
|
|
91
|
+
marginBottom?: ViewStyle['marginBottom'];
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The left margin
|
|
95
|
+
*/
|
|
96
|
+
marginLeft?: ViewStyle['marginLeft'];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Label item alignment
|
|
100
|
+
*/
|
|
101
|
+
labelAlignItems?: ViewStyle['alignItems'];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Label's top margin.
|
|
105
|
+
*/
|
|
106
|
+
labelMarginVertical?: ViewStyle['marginVertical'];
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Label's right margin.
|
|
110
|
+
*/
|
|
111
|
+
labelMarginRight?: ViewStyle['marginRight'];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Label's left margin.
|
|
115
|
+
*/
|
|
116
|
+
labelMarginLeft?: ViewStyle['marginLeft'];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Label's padding.
|
|
120
|
+
*/
|
|
121
|
+
labelPadding?: ViewStyle['marginLeft'];
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* Variant of label subtext.
|
|
125
|
+
*
|
|
126
|
+
* Should only by used if subtext prop is provided.
|
|
127
|
+
*/
|
|
128
|
+
subtextVariant?: keyof Variant;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Padding between label and label subtext.
|
|
132
|
+
*
|
|
133
|
+
* Should only by used if subtext prop is provided.
|
|
134
|
+
*/
|
|
135
|
+
subtextMarginTop?: ViewStyle['marginTop'];
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Padding between label subtext and focus ring.
|
|
139
|
+
*
|
|
140
|
+
* Should only by used if subtext prop is provided.
|
|
141
|
+
*/
|
|
142
|
+
subtextMarginBottom?: ViewStyle['marginBottom'];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Ripple color for Android.
|
|
146
|
+
*
|
|
147
|
+
* A ripple animation is shown on click for Android. This sets the color of the ripple.
|
|
148
|
+
* @platform android
|
|
149
|
+
*/
|
|
150
|
+
rippleColor?: ColorValue;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Ripple radius for circular radio on Android.
|
|
154
|
+
*
|
|
155
|
+
* A ripple animation is shown on click for Android. This sets the radius of the circular ripple shown on the radio button.
|
|
156
|
+
* @platform android
|
|
157
|
+
*/
|
|
158
|
+
rippleRadius?: number;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* States that can be applied to a Radio
|
|
162
|
+
*/
|
|
163
|
+
labelPositionBelow?: RadioTokens;
|
|
164
|
+
selected?: RadioTokens;
|
|
165
|
+
disabled?: RadioTokens;
|
|
166
|
+
hovered?: RadioTokens;
|
|
167
|
+
focused?: RadioTokens;
|
|
168
|
+
pressed?: RadioTokens;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface RadioProps extends PressablePropsExtended {
|
|
172
|
+
/**
|
|
173
|
+
* The text string for the option
|
|
174
|
+
*/
|
|
175
|
+
label: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Label subtext for the option
|
|
179
|
+
*/
|
|
180
|
+
subtext?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* A unique key-identifier for each option
|
|
184
|
+
*/
|
|
185
|
+
value: string;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Whether or not the radio button is selectable
|
|
189
|
+
*/
|
|
190
|
+
disabled?: boolean;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The position of the label relative to the radio indicator.
|
|
194
|
+
*
|
|
195
|
+
* This defaults to 'after' unless the Radio is inside a RadioGroup with layout horizontal-stacked,
|
|
196
|
+
* in which case it defaults to 'below'
|
|
197
|
+
*
|
|
198
|
+
* 'below' is not supported from Fluent Android and Win32, renders as-is.
|
|
199
|
+
* @default after
|
|
200
|
+
*/
|
|
201
|
+
labelPosition?: 'after' | 'below';
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
|
|
205
|
+
*/
|
|
206
|
+
componentRef?: React.RefObject<IFocusable>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Whether to use native focus visuals for the component
|
|
210
|
+
* @default true
|
|
211
|
+
*/
|
|
212
|
+
enableFocusRing?: boolean;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface RadioInfo {
|
|
216
|
+
props: RadioProps & React.ComponentPropsWithRef<any>;
|
|
217
|
+
state: PressableState;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface RadioSlotProps {
|
|
221
|
+
root: React.PropsWithRef<PressablePropsExtended>;
|
|
222
|
+
button: PressablePropsExtended;
|
|
223
|
+
innerCircle: IViewProps;
|
|
224
|
+
labelContent: IViewProps;
|
|
225
|
+
label: TextProps;
|
|
226
|
+
subtext?: TextProps;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface RadioType {
|
|
230
|
+
props: RadioProps;
|
|
231
|
+
tokens: RadioTokens;
|
|
232
|
+
slotProps: RadioSlotProps;
|
|
233
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Theme } from '@fluentui-react-native/framework';
|
|
2
|
+
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
3
|
+
import type { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
4
|
+
|
|
5
|
+
import type { RadioTokens } from './Radio.types';
|
|
6
|
+
|
|
7
|
+
export const defaultRadioTokens: TokenSettings<RadioTokens, Theme> = (t: Theme) =>
|
|
8
|
+
({
|
|
9
|
+
// Tokens for label are taken from Android List Item
|
|
10
|
+
color: t.colors.neutralForeground1,
|
|
11
|
+
variant: 'body1',
|
|
12
|
+
labelMarginLeft: globalTokens.size160,
|
|
13
|
+
labelPadding: globalTokens.size20,
|
|
14
|
+
subtextVariant: 'caption1',
|
|
15
|
+
flexDirection: 'row',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
labelPositionBelow: {
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
marginLeft: globalTokens.sizeNone,
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
marginTop: 24 - 20, // Size - Outer Circle Size
|
|
23
|
+
marginBottom: 24 - 20, // Size - Outer Circle Size
|
|
24
|
+
marginLeft: 24 - 20, // Size - Outer Circle Size
|
|
25
|
+
marginRight: 24 - 20, // Size - Outer Circle Size
|
|
26
|
+
radioOuterCircleSize: 20,
|
|
27
|
+
radioInnerCircleSize: 10,
|
|
28
|
+
radioBorderStyle: 'solid',
|
|
29
|
+
radioBorderWidth: globalTokens.stroke.width15,
|
|
30
|
+
rippleRadius: globalTokens.size160,
|
|
31
|
+
rippleColor: '#D4D4D4',
|
|
32
|
+
|
|
33
|
+
// Unselected, Rest
|
|
34
|
+
radioBorder: t.colors.neutralStrokeAccessible,
|
|
35
|
+
radioVisibility: 0,
|
|
36
|
+
|
|
37
|
+
disabled: {
|
|
38
|
+
// Unselected, Disabled
|
|
39
|
+
rippleColor: '#D4D4D4',
|
|
40
|
+
radioBorder: t.colors.neutralStrokeDisabled,
|
|
41
|
+
radioVisibility: 0,
|
|
42
|
+
color: t.colors.neutralForegroundDisabled1,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
selected: {
|
|
46
|
+
// Selected, Rest
|
|
47
|
+
radioBorder: t.colors.brandBackground,
|
|
48
|
+
radioFill: t.colors.brandForeground1,
|
|
49
|
+
radioVisibility: 1,
|
|
50
|
+
|
|
51
|
+
disabled: {
|
|
52
|
+
// Selected, Disabled
|
|
53
|
+
radioBorder: t.colors.brandBackgroundDisabled,
|
|
54
|
+
radioFill: t.colors.brandForegroundDisabled2,
|
|
55
|
+
radioVisibility: 1,
|
|
56
|
+
color: t.colors.neutralForegroundDisabled1,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
} as RadioTokens);
|