@fluentui/react-radio 9.1.3 → 9.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +115 -1
  3. package/CHANGELOG.md +34 -2
  4. package/lib/Radio.js.map +1 -1
  5. package/lib/RadioGroup.js.map +1 -1
  6. package/lib/RadioGroupField.js.map +1 -1
  7. package/lib/components/Radio/Radio.js.map +1 -1
  8. package/lib/components/Radio/Radio.types.js +1 -1
  9. package/lib/components/Radio/Radio.types.js.map +1 -1
  10. package/lib/components/Radio/index.js.map +1 -1
  11. package/lib/components/Radio/renderRadio.js +1 -9
  12. package/lib/components/Radio/renderRadio.js.map +1 -1
  13. package/lib/components/Radio/useRadio.js +5 -3
  14. package/lib/components/Radio/useRadio.js.map +1 -1
  15. package/lib/components/Radio/useRadioStyles.js.map +1 -1
  16. package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
  17. package/lib/components/RadioGroup/RadioGroup.types.js +1 -1
  18. package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
  19. package/lib/components/RadioGroup/index.js.map +1 -1
  20. package/lib/components/RadioGroup/renderRadioGroup.js +1 -3
  21. package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
  22. package/lib/components/RadioGroup/useRadioGroup.js +1 -0
  23. package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
  24. package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
  25. package/lib/components/RadioGroupField/RadioGroupField.js +1 -2
  26. package/lib/components/RadioGroupField/RadioGroupField.js.map +1 -1
  27. package/lib/components/RadioGroupField/index.js.map +1 -1
  28. package/lib/contexts/RadioGroupContext.js.map +1 -1
  29. package/lib/contexts/index.js.map +1 -1
  30. package/lib/contexts/useRadioGroupContextValues.js.map +1 -1
  31. package/lib/index.js.map +1 -1
  32. package/lib-commonjs/Radio.js +5 -4
  33. package/lib-commonjs/Radio.js.map +1 -1
  34. package/lib-commonjs/RadioGroup.js +5 -4
  35. package/lib-commonjs/RadioGroup.js.map +1 -1
  36. package/lib-commonjs/RadioGroupField.js +5 -4
  37. package/lib-commonjs/RadioGroupField.js.map +1 -1
  38. package/lib-commonjs/components/Radio/Radio.js +19 -20
  39. package/lib-commonjs/components/Radio/Radio.js.map +1 -1
  40. package/lib-commonjs/components/Radio/Radio.types.js +5 -2
  41. package/lib-commonjs/components/Radio/Radio.types.js.map +1 -1
  42. package/lib-commonjs/components/Radio/index.js +9 -8
  43. package/lib-commonjs/components/Radio/index.js.map +1 -1
  44. package/lib-commonjs/components/Radio/renderRadio.js +13 -24
  45. package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
  46. package/lib-commonjs/components/Radio/useRadio.js +83 -91
  47. package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
  48. package/lib-commonjs/components/Radio/useRadioStyles.js +139 -65
  49. package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
  50. package/lib-commonjs/components/RadioGroup/RadioGroup.js +21 -22
  51. package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
  52. package/lib-commonjs/components/RadioGroup/RadioGroup.types.js +5 -2
  53. package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -1
  54. package/lib-commonjs/components/RadioGroup/index.js +9 -8
  55. package/lib-commonjs/components/RadioGroup/index.js.map +1 -1
  56. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +16 -21
  57. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
  58. package/lib-commonjs/components/RadioGroup/useRadioGroup.js +40 -50
  59. package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
  60. package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +32 -23
  61. package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
  62. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +17 -11
  63. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +1 -1
  64. package/lib-commonjs/components/RadioGroupField/index.js +5 -4
  65. package/lib-commonjs/components/RadioGroupField/index.js.map +1 -1
  66. package/lib-commonjs/contexts/RadioGroupContext.js +17 -11
  67. package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
  68. package/lib-commonjs/contexts/index.js +6 -5
  69. package/lib-commonjs/contexts/index.js.map +1 -1
  70. package/lib-commonjs/contexts/useRadioGroupContextValues.js +20 -25
  71. package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -1
  72. package/lib-commonjs/index.js +31 -99
  73. package/lib-commonjs/index.js.map +1 -1
  74. package/package.json +13 -12
  75. package/lib-amd/Radio.js +0 -6
  76. package/lib-amd/Radio.js.map +0 -1
  77. package/lib-amd/RadioGroup.js +0 -6
  78. package/lib-amd/RadioGroup.js.map +0 -1
  79. package/lib-amd/RadioGroupField.js +0 -6
  80. package/lib-amd/RadioGroupField.js.map +0 -1
  81. package/lib-amd/components/Radio/Radio.js +0 -17
  82. package/lib-amd/components/Radio/Radio.js.map +0 -1
  83. package/lib-amd/components/Radio/Radio.types.js +0 -5
  84. package/lib-amd/components/Radio/Radio.types.js.map +0 -1
  85. package/lib-amd/components/Radio/index.js +0 -10
  86. package/lib-amd/components/Radio/index.js.map +0 -1
  87. package/lib-amd/components/Radio/renderRadio.js +0 -17
  88. package/lib-amd/components/Radio/renderRadio.js.map +0 -1
  89. package/lib-amd/components/Radio/useRadio.js +0 -65
  90. package/lib-amd/components/Radio/useRadio.js.map +0 -1
  91. package/lib-amd/components/Radio/useRadioStyles.js +0 -158
  92. package/lib-amd/components/Radio/useRadioStyles.js.map +0 -1
  93. package/lib-amd/components/RadioGroup/RadioGroup.js +0 -18
  94. package/lib-amd/components/RadioGroup/RadioGroup.js.map +0 -1
  95. package/lib-amd/components/RadioGroup/RadioGroup.types.js +0 -5
  96. package/lib-amd/components/RadioGroup/RadioGroup.types.js.map +0 -1
  97. package/lib-amd/components/RadioGroup/index.js +0 -10
  98. package/lib-amd/components/RadioGroup/index.js.map +0 -1
  99. package/lib-amd/components/RadioGroup/renderRadioGroup.js +0 -15
  100. package/lib-amd/components/RadioGroup/renderRadioGroup.js.map +0 -1
  101. package/lib-amd/components/RadioGroup/useRadioGroup.js +0 -38
  102. package/lib-amd/components/RadioGroup/useRadioGroup.js.map +0 -1
  103. package/lib-amd/components/RadioGroup/useRadioGroupStyles.js +0 -26
  104. package/lib-amd/components/RadioGroup/useRadioGroupStyles.js.map +0 -1
  105. package/lib-amd/components/RadioGroupField/RadioGroupField.js +0 -10
  106. package/lib-amd/components/RadioGroupField/RadioGroupField.js.map +0 -1
  107. package/lib-amd/components/RadioGroupField/index.js +0 -6
  108. package/lib-amd/components/RadioGroupField/index.js.map +0 -1
  109. package/lib-amd/contexts/RadioGroupContext.js +0 -19
  110. package/lib-amd/contexts/RadioGroupContext.js.map +0 -1
  111. package/lib-amd/contexts/index.js +0 -7
  112. package/lib-amd/contexts/index.js.map +0 -1
  113. package/lib-amd/contexts/useRadioGroupContextValues.js +0 -19
  114. package/lib-amd/contexts/useRadioGroupContextValues.js.map +0 -1
  115. package/lib-amd/index.js +0 -21
  116. package/lib-amd/index.js.map +0 -1
package/.swcrc ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/swcrc",
3
+ "exclude": [
4
+ "/testing",
5
+ "/**/*.cy.ts",
6
+ "/**/*.cy.tsx",
7
+ "/**/*.spec.ts",
8
+ "/**/*.spec.tsx",
9
+ "/**/*.test.ts",
10
+ "/**/*.test.tsx"
11
+ ],
12
+ "jsc": {
13
+ "parser": {
14
+ "syntax": "typescript",
15
+ "tsx": true,
16
+ "decorators": false,
17
+ "dynamicImport": false
18
+ },
19
+ "externalHelpers": true,
20
+ "transform": {
21
+ "react": {
22
+ "runtime": "classic",
23
+ "useSpread": true
24
+ }
25
+ },
26
+ "target": "es2019"
27
+ },
28
+ "minify": false,
29
+ "sourceMaps": true
30
+ }
package/CHANGELOG.json CHANGED
@@ -2,7 +2,121 @@
2
2
  "name": "@fluentui/react-radio",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 15 Mar 2023 10:17:05 GMT",
5
+ "date": "Tue, 21 Mar 2023 21:19:00 GMT",
6
+ "tag": "@fluentui/react-radio_v9.1.5",
7
+ "version": "9.1.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "makotom@microsoft.com",
12
+ "package": "@fluentui/react-radio",
13
+ "commit": "7fde5c94869ff9841b142b7ff1d0a3df0ab58f74",
14
+ "comment": "chore: Bumping version of @fluentui/react-icons to ^2.0.196."
15
+ },
16
+ {
17
+ "author": "tristan.watanabe@gmail.com",
18
+ "package": "@fluentui/react-radio",
19
+ "commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
20
+ "comment": "fix: add node field to package.json exports map."
21
+ },
22
+ {
23
+ "author": "tristan.watanabe@gmail.com",
24
+ "package": "@fluentui/react-radio",
25
+ "commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
26
+ "comment": "chore: migrate to swc transpilation approach."
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-radio",
31
+ "comment": "Bump @fluentui/react-context-selector to v9.1.15",
32
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-radio",
37
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.27",
38
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-radio",
43
+ "comment": "Bump @fluentui/react-label to v9.1.5",
44
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-radio",
49
+ "comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
50
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-radio",
55
+ "comment": "Bump @fluentui/react-tabster to v9.6.1",
56
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui/react-radio",
61
+ "comment": "Bump @fluentui/react-theme to v9.1.7",
62
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui/react-radio",
67
+ "comment": "Bump @fluentui/react-utilities to v9.7.2",
68
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
69
+ },
70
+ {
71
+ "author": "beachball",
72
+ "package": "@fluentui/react-radio",
73
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
74
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "date": "Thu, 16 Mar 2023 14:36:59 GMT",
81
+ "tag": "@fluentui/react-radio_v9.1.4",
82
+ "version": "9.1.4",
83
+ "comments": {
84
+ "patch": [
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-radio",
88
+ "comment": "Bump @fluentui/react-context-selector to v9.1.14",
89
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
90
+ },
91
+ {
92
+ "author": "beachball",
93
+ "package": "@fluentui/react-radio",
94
+ "comment": "Bump @fluentui/react-field to v9.0.0-alpha.26",
95
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
96
+ },
97
+ {
98
+ "author": "beachball",
99
+ "package": "@fluentui/react-radio",
100
+ "comment": "Bump @fluentui/react-label to v9.1.4",
101
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
102
+ },
103
+ {
104
+ "author": "beachball",
105
+ "package": "@fluentui/react-radio",
106
+ "comment": "Bump @fluentui/react-tabster to v9.6.0",
107
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
108
+ },
109
+ {
110
+ "author": "beachball",
111
+ "package": "@fluentui/react-radio",
112
+ "comment": "Bump @fluentui/react-utilities to v9.7.1",
113
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ "date": "Wed, 15 Mar 2023 10:19:53 GMT",
6
120
  "tag": "@fluentui/react-radio_v9.1.3",
7
121
  "version": "9.1.3",
8
122
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,44 @@
1
1
  # Change Log - @fluentui/react-radio
2
2
 
3
- This log was last generated on Wed, 15 Mar 2023 10:17:05 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 21 Mar 2023 21:19:00 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.5)
8
+
9
+ Tue, 21 Mar 2023 21:19:00 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.4..@fluentui/react-radio_v9.1.5)
11
+
12
+ ### Patches
13
+
14
+ - chore: Bumping version of @fluentui/react-icons to ^2.0.196. ([PR #27100](https://github.com/microsoft/fluentui/pull/27100) by makotom@microsoft.com)
15
+ - fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
16
+ - chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
17
+ - Bump @fluentui/react-context-selector to v9.1.15 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
18
+ - Bump @fluentui/react-field to v9.0.0-alpha.27 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
19
+ - Bump @fluentui/react-label to v9.1.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
20
+ - Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
22
+ - Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
23
+ - Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
24
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
25
+
26
+ ## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.4)
27
+
28
+ Thu, 16 Mar 2023 14:36:59 GMT
29
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.3..@fluentui/react-radio_v9.1.4)
30
+
31
+ ### Patches
32
+
33
+ - Bump @fluentui/react-context-selector to v9.1.14 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
34
+ - Bump @fluentui/react-field to v9.0.0-alpha.26 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
35
+ - Bump @fluentui/react-label to v9.1.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
36
+ - Bump @fluentui/react-tabster to v9.6.0 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
37
+ - Bump @fluentui/react-utilities to v9.7.1 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
38
+
7
39
  ## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.3)
8
40
 
9
- Wed, 15 Mar 2023 10:17:05 GMT
41
+ Wed, 15 Mar 2023 10:19:53 GMT
10
42
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.2..@fluentui/react-radio_v9.1.3)
11
43
 
12
44
  ### Patches
package/lib/Radio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/Radio.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './components/Radio/index';\n"]}
1
+ {"version":3,"names":[],"sources":["../src/Radio.ts"],"sourcesContent":["export * from './components/Radio/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/RadioGroup.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/RadioGroup/index';\n"]}
1
+ {"version":3,"names":[],"sources":["../src/RadioGroup.ts"],"sourcesContent":["export * from './components/RadioGroup/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroupField.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/RadioGroupField.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/RadioGroupField/index';\n"]}
1
+ {"version":3,"names":[],"sources":["../src/RadioGroupField.ts"],"sourcesContent":["export * from './components/RadioGroupField/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","renderRadio_unstable","useRadio_unstable","useRadioStyles_unstable","useCustomStyleHooks_unstable","Radio","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-radio/src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { RadioProps } from './Radio.types';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio: ForwardRefComponent<RadioProps> = React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n\n useRadioStyles_unstable(state);\n\n const { useRadioStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadio_unstable(state);\n});\n\nRadio.displayName = 'Radio';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,KAAK,gBAAoCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGP,iBAAiB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAE3CL,uBAAuB,CAACM,KAAK,CAAC;EAE9B,MAAM;IAAEN,uBAAuB,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACnFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOR,oBAAoB,CAACQ,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFJ,KAAK,CAACM,WAAW,GAAG,OAAO"}
1
+ {"version":3,"names":["React","renderRadio_unstable","useRadio_unstable","useRadioStyles_unstable","useCustomStyleHooks_unstable","Radio","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { RadioProps } from './Radio.types';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio: ForwardRefComponent<RadioProps> = React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n\n useRadioStyles_unstable(state);\n\n const { useRadioStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadio_unstable(state);\n});\n\nRadio.displayName = 'Radio';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,4BAA4B,QAAQ;AAE7C;;;AAGA,OAAO,MAAMC,KAAA,gBAAyCL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACrF,MAAMC,KAAA,GAAQP,iBAAA,CAAkBK,KAAA,EAAOC,GAAA;EAEvCL,uBAAA,CAAwBM,KAAA;EAExB,MAAM;IAAEN,uBAAA,EAAyBO;EAAe,CAAE,GAAGN,4BAAA;EACrDM,eAAA,CAAgBD,KAAA;EAEhB,OAAOR,oBAAA,CAAqBQ,KAAA;AAC9B;AAEAJ,KAAA,CAAMM,WAAW,GAAG"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ import * as React from 'react';
2
2
  //# sourceMappingURL=Radio.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/components/Radio/Radio.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"]}
1
+ {"version":3,"names":["React"],"sources":["../../../src/components/Radio/Radio.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/components/Radio/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './Radio';\nexport * from './Radio.types';\nexport * from './renderRadio';\nexport * from './useRadio';\nexport * from './useRadioStyles';\n"]}
1
+ {"version":3,"names":[],"sources":["../../../src/components/Radio/index.ts"],"sourcesContent":["export * from './Radio';\nexport * from './Radio.types';\nexport * from './renderRadio';\nexport * from './useRadio';\nexport * from './useRadioStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -8,14 +8,6 @@ export const renderRadio_unstable = state => {
8
8
  slots,
9
9
  slotProps
10
10
  } = getSlots(state);
11
- return /*#__PURE__*/React.createElement(slots.root, {
12
- ...slotProps.root
13
- }, /*#__PURE__*/React.createElement(slots.input, {
14
- ...slotProps.input
15
- }), /*#__PURE__*/React.createElement(slots.indicator, {
16
- ...slotProps.indicator
17
- }), slots.label && /*#__PURE__*/React.createElement(slots.label, {
18
- ...slotProps.label
19
- }));
11
+ return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), /*#__PURE__*/React.createElement(slots.indicator, slotProps.indicator), slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label));
20
12
  };
21
13
  //# sourceMappingURL=renderRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderRadio_unstable","state","slots","slotProps","createElement","root","input","indicator","label"],"sources":["../src/packages/react-components/react-radio/src/components/Radio/renderRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { RadioSlots, RadioState } from './Radio.types';\n\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = (state: RadioState) => {\n const { slots, slotProps } = getSlots<RadioSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.indicator {...slotProps.indicator} />\n {slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAaE,KAAK,CAAC;EAExD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,gBAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,KAAK;IAAA,GAAKH,SAAS,CAACG;EAAK,EAAI,eACpCR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,SAAS;IAAA,GAAKJ,SAAS,CAACI;EAAS,EAAI,EAC3CL,KAAK,CAACM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACM,KAAK;IAAA,GAAKL,SAAS,CAACK;EAAK,EAAI,CACzC;AAEjB,CAAC"}
1
+ {"version":3,"names":["React","getSlots","renderRadio_unstable","state","slots","slotProps","createElement","root","input","indicator","label"],"sources":["../../../src/components/Radio/renderRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { RadioSlots, RadioState } from './Radio.types';\n\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = (state: RadioState) => {\n const { slots, slotProps } = getSlots<RadioSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.indicator {...slotProps.indicator} />\n {slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,oBAAA,GAAwBC,KAAA,IAAsB;EACzD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAqBE,KAAA;EAElD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,KAAK,EAAKH,SAAA,CAAUG,KAAK,gBAChCR,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,SAAS,EAAKJ,SAAA,CAAUI,SAAS,GACvCL,KAAA,CAAMM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK;AAGtD"}
@@ -55,9 +55,11 @@ export const useRadio_unstable = (props, ref) => {
55
55
  ...nativeProps.primary
56
56
  }
57
57
  });
58
- input.onChange = mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
59
- value: ev.currentTarget.value
60
- }));
58
+ input.onChange = mergeCallbacks(input.onChange, ev => {
59
+ return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
60
+ value: ev.currentTarget.value
61
+ });
62
+ });
61
63
  const label = resolveShorthand(props.label, {
62
64
  defaultProps: {
63
65
  htmlFor: input.id,
@@ -1 +1 @@
1
- {"version":3,"names":["React","CircleFilled","Label","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useRadioGroupContext_unstable","useFocusWithin","useRadio_unstable","props","ref","nameGroup","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","primarySlotTagName","excludedPropNames","root","defaultProps","input","type","id","primary","ev","currentTarget","label","htmlFor","indicator","children","createElement","components"],"sources":["../src/packages/react-components/react-radio/src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"mappings":"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"}
1
+ {"version":3,"names":["React","CircleFilled","Label","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useRadioGroupContext_unstable","useFocusWithin","useRadio_unstable","props","ref","nameGroup","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","primarySlotTagName","excludedPropNames","root","defaultProps","input","type","id","primary","ev","currentTarget","label","htmlFor","indicator","children","createElement","components"],"sources":["../../../src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"names":["createFocusOutlineStyle","tokens","__resetStyles","__styles","mergeClasses","shorthands","radioClassNames","root","indicator","input","label","indicatorSize","useRootBaseClassName","useRootStyles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","useRadioStyles_unstable","state","labelPosition","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","indicatorBaseClassName","labelStyles"],"sources":["../src/packages/react-components/react-radio/src/components/Radio/useRadioStyles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { RadioSlots, RadioState } from './Radio.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioClassNames: SlotClassNames<RadioSlots> = {\n root: 'fui-Radio',\n indicator: 'fui-Radio__indicator',\n input: 'fui-Radio__input',\n label: 'fui-Radio__label',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n width: `calc(${indicatorSize} + 2 * ${tokens.spacingHorizontalS})`,\n height: '100%',\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n\n ':enabled': {\n cursor: 'pointer',\n [`& ~ .${radioClassNames.label}`]: {\n cursor: 'pointer',\n },\n },\n\n // When unchecked, hide the circle icon (child of the indicator)\n [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {\n opacity: '0',\n },\n\n // Colors for the unchecked state\n ':enabled:not(:checked)': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground3,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessible,\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n },\n\n // Colors for the checked state\n ':enabled:checked': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStroke,\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokeHover,\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokePressed,\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n // Colors for the disabled state\n ':disabled': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'default',\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeDisabled,\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n below: {\n width: '100%',\n height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`,\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n width: indicatorSize,\n height: indicatorSize,\n fontSize: '12px',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid',\n borderRadius: tokens.borderRadiusCircular,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n },\n\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\n\n // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.\n // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.\n marginTop: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n },\n\n below: {\n paddingTop: tokens.spacingVerticalXS,\n textAlign: 'center',\n },\n});\n\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = (state: RadioState) => {\n const { labelPosition } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n radioClassNames.root,\n rootBaseClassName,\n labelPosition === 'below' && rootStyles.vertical,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n radioClassNames.input,\n inputBaseClassName,\n labelPosition === 'below' && inputStyles.below,\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(\n radioClassNames.indicator,\n indicatorBaseClassName,\n state.indicator.className,\n );\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n radioClassNames.label,\n labelStyles.base,\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n};\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAItF,OAAO,MAAMC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,SAAS,EAAE,sBAAsB;EACjCC,KAAK,EAAE,kBAAkB;EACzBC,KAAK,EAAE;CACR;AAED;AACA,MAAMC,aAAa,GAAG,MAAM;AAE5B,MAAMC,oBAAoB,gBAAGV,aAAA,guEAI3B;AAEF,MAAMW,aAAa,gBAAGV,QAAA;EAAAW,QAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAKpB;AAEF,MAAMC,qBAAqB,gBAAGhB,aAAA,46GAsF5B;AAEF,MAAMiB,cAAc,gBAAGhB,QAAA;EAAAiB,KAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAL,CAAA;AAAA,EAKrB;AAEF,MAAMM,yBAAyB,gBAAGrB,aAAA,4lBAiBhC;AAEF;AACA,MAAMsB,cAAc,gBAAGrB,QAAA;EAAAsB,IAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAD,MAAA;IAAAE,OAAA;IAAAC,MAAA;EAAA;EAAAb,KAAA;IAAAO,MAAA;IAAAO,MAAA;EAAA;AAAA;EAAAjB,CAAA;AAAA,EAmBrB;AAEF;;;AAGA,OAAO,MAAMkB,uBAAuB,GAAIC,KAAiB,IAAI;EAC3D,MAAM;IAAEC;EAAa,CAAE,GAAGD,KAAK;EAE/B,MAAME,iBAAiB,GAAG1B,oBAAoB,EAAE;EAChD,MAAM2B,UAAU,GAAG1B,aAAa,EAAE;EAClCuB,KAAK,CAAC7B,IAAI,CAACiC,SAAS,GAAGpC,YAAY,CACjCE,eAAe,CAACC,IAAI,EACpB+B,iBAAiB,EACjBD,aAAa,KAAK,OAAO,IAAIE,UAAU,CAACzB,QAAQ,EAChDsB,KAAK,CAAC7B,IAAI,CAACiC,SAAS,CACrB;EAED,MAAMC,kBAAkB,GAAGvB,qBAAqB,EAAE;EAClD,MAAMwB,WAAW,GAAGvB,cAAc,EAAE;EACpCiB,KAAK,CAAC3B,KAAK,CAAC+B,SAAS,GAAGpC,YAAY,CAClCE,eAAe,CAACG,KAAK,EACrBgC,kBAAkB,EAClBJ,aAAa,KAAK,OAAO,IAAIK,WAAW,CAACtB,KAAK,EAC9CgB,KAAK,CAAC3B,KAAK,CAAC+B,SAAS,CACtB;EAED,MAAMG,sBAAsB,GAAGpB,yBAAyB,EAAE;EAC1Da,KAAK,CAAC5B,SAAS,CAACgC,SAAS,GAAGpC,YAAY,CACtCE,eAAe,CAACE,SAAS,EACzBmC,sBAAsB,EACtBP,KAAK,CAAC5B,SAAS,CAACgC,SAAS,CAC1B;EAED,MAAMI,WAAW,GAAGpB,cAAc,EAAE;EACpC,IAAIY,KAAK,CAAC1B,KAAK,EAAE;IACf0B,KAAK,CAAC1B,KAAK,CAAC8B,SAAS,GAAGpC,YAAY,CAClCE,eAAe,CAACI,KAAK,EACrBkC,WAAW,CAACnB,IAAI,EAChBmB,WAAW,CAACP,aAAa,CAAC,EAC1BD,KAAK,CAAC1B,KAAK,CAAC8B,SAAS,CACtB;;AAEL,CAAC"}
1
+ {"version":3,"names":["createFocusOutlineStyle","tokens","__resetStyles","__styles","mergeClasses","shorthands","radioClassNames","root","indicator","input","label","indicatorSize","useRootBaseClassName","useRootStyles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","useRadioStyles_unstable","state","labelPosition","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","indicatorBaseClassName","labelStyles"],"sources":["../../../src/components/Radio/useRadioStyles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { RadioSlots, RadioState } from './Radio.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioClassNames: SlotClassNames<RadioSlots> = {\n root: 'fui-Radio',\n indicator: 'fui-Radio__indicator',\n input: 'fui-Radio__input',\n label: 'fui-Radio__label',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n width: `calc(${indicatorSize} + 2 * ${tokens.spacingHorizontalS})`,\n height: '100%',\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n\n ':enabled': {\n cursor: 'pointer',\n [`& ~ .${radioClassNames.label}`]: {\n cursor: 'pointer',\n },\n },\n\n // When unchecked, hide the circle icon (child of the indicator)\n [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {\n opacity: '0',\n },\n\n // Colors for the unchecked state\n ':enabled:not(:checked)': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground3,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessible,\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n },\n\n // Colors for the checked state\n ':enabled:checked': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStroke,\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokeHover,\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokePressed,\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n // Colors for the disabled state\n ':disabled': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'default',\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeDisabled,\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n below: {\n width: '100%',\n height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`,\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n width: indicatorSize,\n height: indicatorSize,\n fontSize: '12px',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid',\n borderRadius: tokens.borderRadiusCircular,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n },\n\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\n\n // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.\n // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.\n marginTop: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n },\n\n below: {\n paddingTop: tokens.spacingVerticalXS,\n textAlign: 'center',\n },\n});\n\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = (state: RadioState) => {\n const { labelPosition } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n radioClassNames.root,\n rootBaseClassName,\n labelPosition === 'below' && rootStyles.vertical,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n radioClassNames.input,\n inputBaseClassName,\n labelPosition === 'below' && inputStyles.below,\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(\n radioClassNames.indicator,\n indicatorBaseClassName,\n state.indicator.className,\n );\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n radioClassNames.label,\n labelStyles.base,\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n};\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,MAAM,QAAQ;AACvB,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ;AAItE,OAAO,MAAMC,eAAA,GAA8C;EACzDC,IAAA,EAAM;EACNC,SAAA,EAAW;EACXC,KAAA,EAAO;EACPC,KAAA,EAAO;AACT;AAEA;AACA,MAAMC,aAAA,GAAgB;AAEtB,MAAMC,oBAAA,gBAAuBV,aAAA,guEAI7B;AAEA,MAAMW,aAAA,gBAAgBV,QAAA;EAAAW,QAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAKtB;AAEA,MAAMC,qBAAA,gBAAwBhB,aAAA,46GAsF9B;AAEA,MAAMiB,cAAA,gBAAiBhB,QAAA;EAAAiB,KAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAL,CAAA;AAAA,EAKvB;AAEA,MAAMM,yBAAA,gBAA4BrB,aAAA,4lBAiBlC;AAEA;AACA,MAAMsB,cAAA,gBAAiBrB,QAAA;EAAAsB,IAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAD,MAAA;IAAAE,OAAA;IAAAC,MAAA;EAAA;EAAAb,KAAA;IAAAO,MAAA;IAAAO,MAAA;EAAA;AAAA;EAAAjB,CAAA;AAAA,EAmBvB;AAEA;;;AAGA,OAAO,MAAMkB,uBAAA,GAA2BC,KAAA,IAAsB;EAC5D,MAAM;IAAEC;EAAa,CAAE,GAAGD,KAAA;EAE1B,MAAME,iBAAA,GAAoB1B,oBAAA;EAC1B,MAAM2B,UAAA,GAAa1B,aAAA;EACnBuB,KAAA,CAAM7B,IAAI,CAACiC,SAAS,GAAGpC,YAAA,CACrBE,eAAA,CAAgBC,IAAI,EACpB+B,iBAAA,EACAD,aAAA,KAAkB,WAAWE,UAAA,CAAWzB,QAAQ,EAChDsB,KAAA,CAAM7B,IAAI,CAACiC,SAAS;EAGtB,MAAMC,kBAAA,GAAqBvB,qBAAA;EAC3B,MAAMwB,WAAA,GAAcvB,cAAA;EACpBiB,KAAA,CAAM3B,KAAK,CAAC+B,SAAS,GAAGpC,YAAA,CACtBE,eAAA,CAAgBG,KAAK,EACrBgC,kBAAA,EACAJ,aAAA,KAAkB,WAAWK,WAAA,CAAYtB,KAAK,EAC9CgB,KAAA,CAAM3B,KAAK,CAAC+B,SAAS;EAGvB,MAAMG,sBAAA,GAAyBpB,yBAAA;EAC/Ba,KAAA,CAAM5B,SAAS,CAACgC,SAAS,GAAGpC,YAAA,CAC1BE,eAAA,CAAgBE,SAAS,EACzBmC,sBAAA,EACAP,KAAA,CAAM5B,SAAS,CAACgC,SAAS;EAG3B,MAAMI,WAAA,GAAcpB,cAAA;EACpB,IAAIY,KAAA,CAAM1B,KAAK,EAAE;IACf0B,KAAA,CAAM1B,KAAK,CAAC8B,SAAS,GAAGpC,YAAA,CACtBE,eAAA,CAAgBI,KAAK,EACrBkC,WAAA,CAAYnB,IAAI,EAChBmB,WAAW,CAACP,aAAA,CAAc,EAC1BD,KAAA,CAAM1B,KAAK,CAAC8B,SAAS;EAEzB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","renderRadioGroup_unstable","useRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroupContextValues","useCustomStyleHooks_unstable","RadioGroup","forwardRef","props","ref","state","contextValues","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-radio/src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n\n useRadioGroupStyles_unstable(state);\n\n const { useRadioGroupStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadioGroup_unstable(state, contextValues);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,0BAA0B,QAAQ,2CAA2C;AACtF,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,UAAU,gBAAyCN,KAAK,CAACO,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGR,sBAAsB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAChD,MAAME,aAAa,GAAGP,0BAA0B,CAACM,KAAK,CAAC;EAEvDP,4BAA4B,CAACO,KAAK,CAAC;EAEnC,MAAM;IAAEP,4BAA4B,EAAES;EAAe,CAAE,GAAGP,4BAA4B,EAAE;EACxFO,eAAe,CAACF,KAAK,CAAC;EAEtB,OAAOT,yBAAyB,CAACS,KAAK,EAAEC,aAAa,CAAC;AACxD,CAAC,CAAC;AAEFL,UAAU,CAACO,WAAW,GAAG,YAAY"}
1
+ {"version":3,"names":["React","renderRadioGroup_unstable","useRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroupContextValues","useCustomStyleHooks_unstable","RadioGroup","forwardRef","props","ref","state","contextValues","useCustomStyles","displayName"],"sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n\n useRadioGroupStyles_unstable(state);\n\n const { useRadioGroupStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadioGroup_unstable(state, contextValues);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,sBAAsB,QAAQ;AACvC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,4BAA4B,QAAQ;AAE7C;;;AAGA,OAAO,MAAMC,UAAA,gBAAmDN,KAAA,CAAMO,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC/F,MAAMC,KAAA,GAAQR,sBAAA,CAAuBM,KAAA,EAAOC,GAAA;EAC5C,MAAME,aAAA,GAAgBP,0BAAA,CAA2BM,KAAA;EAEjDP,4BAAA,CAA6BO,KAAA;EAE7B,MAAM;IAAEP,4BAAA,EAA8BS;EAAe,CAAE,GAAGP,4BAAA;EAC1DO,eAAA,CAAgBF,KAAA;EAEhB,OAAOT,yBAAA,CAA0BS,KAAA,EAAOC,aAAA;AAC1C;AAEAL,UAAA,CAAWO,WAAW,GAAG"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ import * as React from 'react';
2
2
  //# sourceMappingURL=RadioGroup.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require a selection in this group. Adds the `required` prop to all child Radio items.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"]}
1
+ {"version":3,"names":["React"],"sources":["../../../src/components/RadioGroup/RadioGroup.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require a selection in this group. Adds the `required` prop to all child Radio items.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/components/RadioGroup/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './RadioGroup';\nexport * from './RadioGroup.types';\nexport * from './renderRadioGroup';\nexport * from './useRadioGroup';\nexport * from './useRadioGroupStyles';\n"]}
1
+ {"version":3,"names":[],"sources":["../../../src/components/RadioGroup/index.ts"],"sourcesContent":["export * from './RadioGroup';\nexport * from './RadioGroup.types';\nexport * from './renderRadioGroup';\nexport * from './useRadioGroup';\nexport * from './useRadioGroupStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -11,8 +11,6 @@ export const renderRadioGroup_unstable = (state, contextValues) => {
11
11
  } = getSlots(state);
12
12
  return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
13
13
  value: contextValues.radioGroup
14
- }, /*#__PURE__*/React.createElement(slots.root, {
15
- ...slotProps.root
16
- }));
14
+ }, /*#__PURE__*/React.createElement(slots.root, slotProps.root));
17
15
  };
18
16
  //# sourceMappingURL=renderRadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","RadioGroupContext","renderRadioGroup_unstable","state","contextValues","slots","slotProps","createElement","Provider","value","radioGroup","root"],"sources":["../src/packages/react-components/react-radio/src/components/RadioGroup/renderRadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,iBAAiB,QAAQ,kCAAkC;AAGpE;;;AAGA,OAAO,MAAMC,yBAAyB,GAAGA,CAACC,KAAsB,EAAEC,aAAsC,KAAI;EAC1G,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAkBG,KAAK,CAAC;EAE7D,oBACEJ,KAAA,CAAAQ,aAAA,CAACN,iBAAiB,CAACO,QAAQ;IAACC,KAAK,EAAEL,aAAa,CAACM;EAAU,gBACzDX,KAAA,CAAAQ,aAAA,CAACF,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,CACP;AAEjC,CAAC"}
1
+ {"version":3,"names":["React","getSlots","RadioGroupContext","renderRadioGroup_unstable","state","contextValues","slots","slotProps","createElement","Provider","value","radioGroup","root"],"sources":["../../../src/components/RadioGroup/renderRadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AACzB,SAASC,iBAAiB,QAAQ;AAGlC;;;AAGA,OAAO,MAAMC,yBAAA,GAA4BA,CAACC,KAAA,EAAwBC,aAAA,KAA2C;EAC3G,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,QAAA,CAA0BG,KAAA;EAEvD,oBACEJ,KAAA,CAAAQ,aAAA,CAACN,iBAAA,CAAkBO,QAAQ;IAACC,KAAA,EAAOL,aAAA,CAAcM;kBAC/CX,KAAA,CAAAQ,aAAA,CAACF,KAAA,CAAMM,IAAI,EAAKL,SAAA,CAAUK,IAAI;AAGpC"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';
2
3
  /**
3
4
  * Create the state required to render RadioGroup.
@@ -1 +1 @@
1
- {"version":3,"names":["getNativeElementProps","isHTMLElement","useEventCallback","useId","useRadioGroup_unstable","props","ref","generatedName","name","value","defaultValue","disabled","layout","onChange","required","components","root","role","ev","target","constructorName","type"],"sources":["../src/packages/react-components/react-radio/src/components/RadioGroup/useRadioGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;\n\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (\n onChange &&\n isHTMLElement(ev.target, { constructorName: 'HTMLInputElement' }) &&\n ev.target.type === 'radio'\n ) {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AAGzG;;;;;;;;;AASA,OAAO,MAAMC,sBAAsB,GAAGA,CAACC,KAAsB,EAAEC,GAA8B,KAAqB;EAChH,MAAMC,aAAa,GAAGJ,KAAK,CAAC,aAAa,CAAC;EAE1C,MAAM;IAAEK,IAAI,GAAGD,aAAa;IAAEE,KAAK;IAAEC,YAAY;IAAEC,QAAQ;IAAEC,MAAM,GAAG,UAAU;IAAEC,QAAQ;IAAEC;EAAQ,CAAE,GAAGT,KAAK;EAE9G,OAAO;IACLO,MAAM;IACNJ,IAAI;IACJC,KAAK;IACLC,YAAY;IACZC,QAAQ;IACRG,QAAQ;IACRC,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAE;MACJV,GAAG;MACHW,IAAI,EAAE,YAAY;MAClB,GAAGjB,qBAAqB,CAAC,KAAK,EAAEK,KAAK,EAAE,sBAAuB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;MACnFQ,QAAQ,EAAEX,gBAAgB,CAACgB,EAAE,IAAG;QAC9B,IACEL,QAAQ,IACRZ,aAAa,CAACiB,EAAE,CAACC,MAAM,EAAE;UAAEC,eAAe,EAAE;QAAkB,CAAE,CAAC,IACjEF,EAAE,CAACC,MAAM,CAACE,IAAI,KAAK,OAAO,EAC1B;UACAR,QAAQ,CAACK,EAAE,EAAE;YAAET,KAAK,EAAES,EAAE,CAACC,MAAM,CAACV;UAAK,CAAE,CAAC;;MAE5C,CAAC;;GAEJ;AACH,CAAC"}
1
+ {"version":3,"names":["React","getNativeElementProps","isHTMLElement","useEventCallback","useId","useRadioGroup_unstable","props","ref","generatedName","name","value","defaultValue","disabled","layout","onChange","required","components","root","role","ev","target","constructorName","type"],"sources":["../../../src/components/RadioGroup/useRadioGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;\n\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (\n onChange &&\n isHTMLElement(ev.target, { constructorName: 'HTMLInputElement' }) &&\n ev.target.type === 'radio'\n ) {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AAG9E;;;;;;;;;AASA,OAAO,MAAMC,sBAAA,GAAyBA,CAACC,KAAA,EAAwBC,GAAA,KAAoD;EACjH,MAAMC,aAAA,GAAgBJ,KAAA,CAAM;EAE5B,MAAM;IAAEK,IAAA,GAAOD,aAAA;IAAeE,KAAA;IAAOC,YAAA;IAAcC,QAAA;IAAUC,MAAA,GAAS;IAAYC,QAAA;IAAUC;EAAQ,CAAE,GAAGT,KAAA;EAEzG,OAAO;IACLO,MAAA;IACAJ,IAAA;IACAC,KAAA;IACAC,YAAA;IACAC,QAAA;IACAG,QAAA;IACAC,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAA,IAAA,EAAM;MACJV,GAAA;MACAW,IAAA,EAAM;MACN,GAAGjB,qBAAA,CAAsB,OAAOK,KAAA,EAAO,sBAAuB,CAAC,YAAY,OAAO,CAAC;MACnFQ,QAAA,EAAUX,gBAAA,CAAiBgB,EAAA,IAAM;QAC/B,IACEL,QAAA,IACAZ,aAAA,CAAciB,EAAA,CAAGC,MAAM,EAAE;UAAEC,eAAA,EAAiB;QAAmB,MAC/DF,EAAA,CAAGC,MAAM,CAACE,IAAI,KAAK,SACnB;UACAR,QAAA,CAASK,EAAA,EAAI;YAAET,KAAA,EAAOS,EAAA,CAAGC,MAAM,CAACV;UAAM;QACxC;MACF;IACF;EACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","radioGroupClassNames","root","useStyles","mc9l5x","Bt984gj","vertical","Beiy3e4","d","useRadioGroupStyles_unstable","state","styles","className","layout"],"sources":["../src/packages/react-components/react-radio/src/components/RadioGroup/useRadioGroupStyles.ts"],"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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AAIzD,OAAO,MAAMC,oBAAoB,GAAoC;EACnEC,IAAI,EAAE;CACP;AAED,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAShB;AAEF;;;AAGA,OAAO,MAAMC,4BAA4B,GAAIC,KAAsB,IAAI;EACrE,MAAMC,MAAM,GAAGR,SAAS,EAAE;EAC1BO,KAAK,CAACR,IAAI,CAACU,SAAS,GAAGZ,YAAY,CACjCC,oBAAoB,CAACC,IAAI,EACzBS,MAAM,CAACT,IAAI,EACXQ,KAAK,CAACG,MAAM,KAAK,UAAU,IAAIF,MAAM,CAACL,QAAQ,EAC9CI,KAAK,CAACR,IAAI,CAACU,SAAS,CACrB;AACH,CAAC"}
1
+ {"version":3,"names":["__styles","mergeClasses","radioGroupClassNames","root","useStyles","mc9l5x","Bt984gj","vertical","Beiy3e4","d","useRadioGroupStyles_unstable","state","styles","className","layout"],"sources":["../../../src/components/RadioGroup/useRadioGroupStyles.ts"],"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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AAIzC,OAAO,MAAMC,oBAAA,GAAwD;EACnEC,IAAA,EAAM;AACR;AAEA,MAAMC,SAAA,gBAAYJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EASlB;AAEA;;;AAGA,OAAO,MAAMC,4BAAA,GAAgCC,KAAA,IAA2B;EACtE,MAAMC,MAAA,GAASR,SAAA;EACfO,KAAA,CAAMR,IAAI,CAACU,SAAS,GAAGZ,YAAA,CACrBC,oBAAA,CAAqBC,IAAI,EACzBS,MAAA,CAAOT,IAAI,EACXQ,KAAA,CAAMG,MAAM,KAAK,cAAcF,MAAA,CAAOL,QAAQ,EAC9CI,KAAA,CAAMR,IAAI,CAACU,SAAS;AAExB"}
@@ -1,5 +1,4 @@
1
- /* eslint-disable deprecation/deprecation */
2
- import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
1
+ /* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
3
2
  import { RadioGroup, radioGroupClassNames } from '../../RadioGroup';
4
3
  /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
5
4
  export const radioGroupFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(radioGroupClassNames.root);
@@ -1 +1 @@
1
- {"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","RadioGroup","radioGroupClassNames","radioGroupFieldClassNames","root","RadioGroupField"],"sources":["../src/packages/react-components/react-radio/src/components/RadioGroupField/RadioGroupField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroup, radioGroupClassNames, RadioGroupProps } from '../../RadioGroup';\n\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport type RadioGroupFieldProps = DeprecatedFieldProps<RadioGroupProps>;\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const radioGroupFieldClassNames = getDeprecatedFieldClassNames(radioGroupClassNames.root);\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const RadioGroupField: ForwardRefComponent<RadioGroupFieldProps> = makeDeprecatedField(RadioGroup);\n"],"mappings":"AAAA;AACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ,uBAAuB;AAE/G,SAASC,UAAU,EAAEC,oBAAoB,QAAyB,kBAAkB;AAIpF;AACA,OAAO,MAAMC,yBAAyB,gBAAGJ,4BAA4B,CAACG,oBAAoB,CAACE,IAAI,CAAC;AAChG;AACA,OAAO,MAAMC,eAAe,gBAA8CL,mBAAmB,CAACC,UAAU,CAAC"}
1
+ {"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","RadioGroup","radioGroupClassNames","radioGroupFieldClassNames","root","RadioGroupField"],"sources":["../../../src/components/RadioGroupField/RadioGroupField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroup, radioGroupClassNames, RadioGroupProps } from '../../RadioGroup';\n\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport type RadioGroupFieldProps = DeprecatedFieldProps<RadioGroupProps>;\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const radioGroupFieldClassNames = getDeprecatedFieldClassNames(radioGroupClassNames.root);\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const RadioGroupField: ForwardRefComponent<RadioGroupFieldProps> = makeDeprecatedField(RadioGroup);\n"],"mappings":"AAAA,4CACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ;AAExF,SAASC,UAAU,EAAEC,oBAAoB,QAAyB;AAIlE;AACA,OAAO,MAAMC,yBAAA,gBAA4BJ,4BAAA,CAA6BG,oBAAA,CAAqBE,IAAI;AAC/F;AACA,OAAO,MAAMC,eAAA,gBAA6DL,mBAAA,CAAoBC,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/components/RadioGroupField/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './RadioGroupField';\n"]}
1
+ {"version":3,"names":[],"sources":["../../../src/components/RadioGroupField/index.ts"],"sourcesContent":["export * from './RadioGroupField';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContextSelector","RadioGroupContext","undefined","radioGroupContextDefaultValue","RadioGroupProvider","Provider","useRadioGroupContext_unstable","selector","ctx"],"sources":["../src/packages/react-components/react-radio/src/contexts/RadioGroupContext.ts"],"sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext: Context<RadioGroupContextValue> = createContext<RadioGroupContextValue | undefined>(\n undefined,\n) as Context<RadioGroupContextValue>;\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAyB,kCAAkC;AAIrG;;;AAGA,OAAO,MAAMC,iBAAiB,gBAAoCF,aAAa,CAC7EG,SAAS,CACyB;AAEpC,MAAMC,6BAA6B,GAA2B,EAAE;AAEhE,OAAO,MAAMC,kBAAkB,GAAGH,iBAAiB,CAACI,QAAQ;AAE5D,OAAO,MAAMC,6BAA6B,GAAOC,QAAoD,IACnGP,kBAAkB,CAACC,iBAAiB,EAAE,CAACO,GAAG,GAAGL,6BAA6B,KAAKI,QAAQ,CAACC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"names":["createContext","useContextSelector","RadioGroupContext","undefined","radioGroupContextDefaultValue","RadioGroupProvider","Provider","useRadioGroupContext_unstable","selector","ctx"],"sources":["../../src/contexts/RadioGroupContext.ts"],"sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext: Context<RadioGroupContextValue> = createContext<RadioGroupContextValue | undefined>(\n undefined,\n) as Context<RadioGroupContextValue>;\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAyB;AAInE;;;AAGA,OAAO,MAAMC,iBAAA,gBAAqDF,aAAA,CAChEG,SAAA;AAGF,MAAMC,6BAAA,GAAwD,CAAC;AAE/D,OAAO,MAAMC,kBAAA,GAAqBH,iBAAA,CAAkBI,QAAQ;AAE5D,OAAO,MAAMC,6BAAA,GAAoCC,QAAA,IAC/CP,kBAAA,CAAmBC,iBAAA,EAAmB,CAACO,GAAA,GAAML,6BAA6B,KAAKI,QAAA,CAASC,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-radio/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"]}
1
+ {"version":3,"names":[],"sources":["../../src/contexts/index.ts"],"sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"],"mappings":"AAAA,cAAc;AACd,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup"],"sources":["../src/packages/react-components/react-radio/src/contexts/useRadioGroupContextValues.ts"],"sourcesContent":["import type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n\n const radioGroup: RadioGroupContextValue = {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n };\n\n return { radioGroup };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,0BAA0B,GAAIC,KAAsB,IAA6B;EAC5F,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,YAAY;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAQ,CAAE,GAAGN,KAAK;EAEvE,MAAMO,UAAU,GAA2B;IACzCN,IAAI;IACJC,KAAK;IACLC,YAAY;IACZC,QAAQ;IACRC,MAAM;IACNC;GACD;EAED,OAAO;IAAEC;EAAU,CAAE;AACvB,CAAC"}
1
+ {"version":3,"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup"],"sources":["../../src/contexts/useRadioGroupContextValues.ts"],"sourcesContent":["import type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n\n const radioGroup: RadioGroupContextValue = {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n };\n\n return { radioGroup };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,0BAAA,GAA8BC,KAAA,IAAoD;EAC7F,MAAM;IAAEC,IAAA;IAAMC,KAAA;IAAOC,YAAA;IAAcC,QAAA;IAAUC,MAAA;IAAQC;EAAQ,CAAE,GAAGN,KAAA;EAElE,MAAMO,UAAA,GAAqC;IACzCN,IAAA;IACAC,KAAA;IACAC,YAAA;IACAC,QAAA;IACAC,MAAA;IACAC;EACF;EAEA,OAAO;IAAEC;EAAW;AACtB"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable","RadioGroupProvider","useRadioGroupContextValues","useRadioGroupContext_unstable","RadioGroupField","RadioGroupField_unstable","radioGroupFieldClassNames"],"sources":["../src/packages/react-components/react-radio/src/index.ts"],"sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { RadioGroupFieldProps as RadioGroupFieldProps_unstable } from './RadioGroupField';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,cAAc;AASrB,SAASC,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,SAAS;AAElH,SAASC,kBAAkB,EAAEC,0BAA0B,EAAEC,6BAA6B,QAAQ,kBAAkB;AAEhH;AACA,SAASC,eAAe,IAAIC,wBAAwB,EAAEC,yBAAyB,QAAQ,mBAAmB"}
1
+ {"version":3,"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable","RadioGroupProvider","useRadioGroupContextValues","useRadioGroupContext_unstable","RadioGroupField","RadioGroupField_unstable","radioGroupFieldClassNames"],"sources":["../src/index.ts"],"sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { RadioGroupFieldProps as RadioGroupFieldProps_unstable } from './RadioGroupField';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB;AASP,SAASC,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAEzG,SAASC,kBAAkB,EAAEC,0BAA0B,EAAEC,6BAA6B,QAAQ;AAE9F;AACA,SAASC,eAAA,IAAmBC,wBAAwB,EAAEC,yBAAyB,QAAQ"}