@fluentui/react-button 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0

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.
Files changed (233) hide show
  1. package/CHANGELOG.md +116 -12
  2. package/dist/index.d.cts +331 -0
  3. package/dist/index.d.ts +50 -52
  4. package/lib/Button.js +1 -1
  5. package/lib/Button.js.map +1 -1
  6. package/lib/CompoundButton.js +1 -1
  7. package/lib/CompoundButton.js.map +1 -1
  8. package/lib/MenuButton.js +1 -1
  9. package/lib/MenuButton.js.map +1 -1
  10. package/lib/SplitButton.js +1 -1
  11. package/lib/SplitButton.js.map +1 -1
  12. package/lib/ToggleButton.js +1 -1
  13. package/lib/ToggleButton.js.map +1 -1
  14. package/lib/components/Button/Button.js +5 -5
  15. package/lib/components/Button/Button.js.map +1 -1
  16. package/lib/components/Button/Button.types.js.map +1 -1
  17. package/lib/components/Button/index.js +4 -5
  18. package/lib/components/Button/index.js.map +1 -1
  19. package/lib/components/Button/renderButton.js +1 -1
  20. package/lib/components/Button/renderButton.js.map +1 -1
  21. package/lib/components/Button/useButton.js +35 -6
  22. package/lib/components/Button/useButton.js.map +1 -1
  23. package/lib/components/Button/useButtonStyles.styles.js +6 -6
  24. package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
  25. package/lib/components/Button/useButtonStyles.styles.raw.js +6 -5
  26. package/lib/components/Button/useButtonStyles.styles.raw.js.map +1 -1
  27. package/lib/components/CompoundButton/CompoundButton.js +5 -5
  28. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  29. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  30. package/lib/components/CompoundButton/index.js +4 -5
  31. package/lib/components/CompoundButton/index.js.map +1 -1
  32. package/lib/components/CompoundButton/renderCompoundButton.js +1 -1
  33. package/lib/components/CompoundButton/useCompoundButton.js +23 -11
  34. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  35. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js +7 -5
  36. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  37. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js +7 -4
  38. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -1
  39. package/lib/components/MenuButton/MenuButton.js +5 -5
  40. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  41. package/lib/components/MenuButton/MenuButton.types.js +3 -1
  42. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  43. package/lib/components/MenuButton/index.js +4 -5
  44. package/lib/components/MenuButton/index.js.map +1 -1
  45. package/lib/components/MenuButton/renderMenuButton.js +1 -1
  46. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  47. package/lib/components/MenuButton/useMenuButton.js +52 -14
  48. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  49. package/lib/components/MenuButton/useMenuButtonStyles.styles.js +7 -6
  50. package/lib/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
  51. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.js +7 -5
  52. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.js.map +1 -1
  53. package/lib/components/SplitButton/SplitButton.js +5 -5
  54. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  55. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  56. package/lib/components/SplitButton/index.js +4 -5
  57. package/lib/components/SplitButton/index.js.map +1 -1
  58. package/lib/components/SplitButton/renderSplitButton.js +1 -1
  59. package/lib/components/SplitButton/useSplitButton.js +53 -17
  60. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  61. package/lib/components/SplitButton/useSplitButtonStyles.styles.js +6 -5
  62. package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  63. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js +6 -4
  64. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -1
  65. package/lib/components/ToggleButton/ToggleButton.js +5 -5
  66. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  67. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  68. package/lib/components/ToggleButton/index.js +4 -5
  69. package/lib/components/ToggleButton/index.js.map +1 -1
  70. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  71. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  72. package/lib/components/ToggleButton/useToggleButton.js +16 -14
  73. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  74. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js +65 -9
  75. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  76. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js +58 -10
  77. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -1
  78. package/lib/contexts/ButtonContext.js +5 -3
  79. package/lib/contexts/ButtonContext.js.map +1 -1
  80. package/lib/contexts/index.js +1 -1
  81. package/lib/contexts/index.js.map +1 -1
  82. package/lib/index.js +7 -13
  83. package/lib/index.js.map +1 -1
  84. package/lib/utils/index.js +1 -1
  85. package/lib/utils/index.js.map +1 -1
  86. package/lib/utils/useToggleState.js +4 -3
  87. package/lib/utils/useToggleState.js.map +1 -1
  88. package/lib-commonjs/{Button.js → Button.cjs} +1 -1
  89. package/lib-commonjs/{Button.js.map → Button.cjs.map} +1 -1
  90. package/lib-commonjs/{CompoundButton.js → CompoundButton.cjs} +1 -4
  91. package/lib-commonjs/CompoundButton.cjs.map +1 -0
  92. package/lib-commonjs/{MenuButton.js → MenuButton.cjs} +1 -1
  93. package/lib-commonjs/{MenuButton.js.map → MenuButton.cjs.map} +1 -1
  94. package/lib-commonjs/{SplitButton.js → SplitButton.cjs} +1 -4
  95. package/lib-commonjs/SplitButton.cjs.map +1 -0
  96. package/lib-commonjs/{ToggleButton.js → ToggleButton.cjs} +1 -1
  97. package/lib-commonjs/{ToggleButton.js.map → ToggleButton.cjs.map} +1 -1
  98. package/lib-commonjs/components/Button/{Button.js → Button.cjs} +3 -3
  99. package/lib-commonjs/components/Button/{Button.js.map → Button.cjs.map} +1 -1
  100. package/lib-commonjs/components/Button/{Button.types.js.map → Button.types.cjs.map} +1 -1
  101. package/lib-commonjs/components/Button/{index.js → index.cjs} +5 -6
  102. package/lib-commonjs/components/Button/index.cjs.map +1 -0
  103. package/lib-commonjs/components/Button/renderButton.cjs.map +1 -0
  104. package/lib-commonjs/components/Button/useButton.cjs +58 -0
  105. package/lib-commonjs/components/Button/useButton.cjs.map +1 -0
  106. package/lib-commonjs/components/Button/{useButtonStyles.styles.js → useButtonStyles.styles.cjs} +2 -1
  107. package/lib-commonjs/components/Button/useButtonStyles.styles.cjs.map +1 -0
  108. package/lib-commonjs/components/Button/{useButtonStyles.styles.raw.js → useButtonStyles.styles.raw.cjs} +2 -1
  109. package/lib-commonjs/components/Button/{useButtonStyles.styles.raw.js.map → useButtonStyles.styles.raw.cjs.map} +1 -1
  110. package/lib-commonjs/components/CompoundButton/{CompoundButton.js → CompoundButton.cjs} +3 -3
  111. package/lib-commonjs/components/CompoundButton/{CompoundButton.js.map → CompoundButton.cjs.map} +1 -1
  112. package/lib-commonjs/components/CompoundButton/CompoundButton.types.cjs.map +1 -0
  113. package/lib-commonjs/components/CompoundButton/{index.js → index.cjs} +4 -8
  114. package/lib-commonjs/components/CompoundButton/index.cjs.map +1 -0
  115. package/lib-commonjs/components/CompoundButton/{useCompoundButtonBase.js → useCompoundButton.cjs} +6 -7
  116. package/lib-commonjs/components/CompoundButton/useCompoundButton.cjs.map +1 -0
  117. package/lib-commonjs/components/CompoundButton/{useCompoundButtonStyles.styles.js → useCompoundButtonStyles.styles.cjs} +5 -2
  118. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.cjs.map +1 -0
  119. package/lib-commonjs/components/CompoundButton/{useCompoundButtonStyles.styles.raw.js → useCompoundButtonStyles.styles.raw.cjs} +5 -2
  120. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.cjs.map +1 -0
  121. package/lib-commonjs/components/MenuButton/{MenuButton.js → MenuButton.cjs} +3 -3
  122. package/lib-commonjs/components/MenuButton/{MenuButton.js.map → MenuButton.cjs.map} +1 -1
  123. package/lib-commonjs/components/MenuButton/MenuButton.types.cjs +6 -0
  124. package/lib-commonjs/components/MenuButton/MenuButton.types.cjs.map +1 -0
  125. package/lib-commonjs/components/MenuButton/{index.js → index.cjs} +5 -6
  126. package/lib-commonjs/components/MenuButton/index.cjs.map +1 -0
  127. package/lib-commonjs/components/MenuButton/renderMenuButton.cjs.map +1 -0
  128. package/lib-commonjs/components/MenuButton/useMenuButton.cjs +65 -0
  129. package/lib-commonjs/components/MenuButton/useMenuButton.cjs.map +1 -0
  130. package/lib-commonjs/components/MenuButton/{useMenuButtonStyles.styles.js → useMenuButtonStyles.styles.cjs} +4 -2
  131. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.cjs.map +1 -0
  132. package/lib-commonjs/components/MenuButton/{useMenuButtonStyles.styles.raw.js → useMenuButtonStyles.styles.raw.cjs} +4 -2
  133. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.cjs.map +1 -0
  134. package/lib-commonjs/components/SplitButton/{SplitButton.js → SplitButton.cjs} +3 -3
  135. package/lib-commonjs/components/SplitButton/SplitButton.cjs.map +1 -0
  136. package/lib-commonjs/components/SplitButton/SplitButton.types.cjs.map +1 -0
  137. package/lib-commonjs/components/SplitButton/{index.js → index.cjs} +4 -8
  138. package/lib-commonjs/components/SplitButton/index.cjs.map +1 -0
  139. package/lib-commonjs/components/SplitButton/{useSplitButtonBase.js → useSplitButton.cjs} +21 -14
  140. package/lib-commonjs/components/SplitButton/useSplitButton.cjs.map +1 -0
  141. package/lib-commonjs/components/SplitButton/{useSplitButtonStyles.styles.js → useSplitButtonStyles.styles.cjs} +3 -1
  142. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.cjs.map +1 -0
  143. package/lib-commonjs/components/SplitButton/{useSplitButtonStyles.styles.raw.js → useSplitButtonStyles.styles.raw.cjs} +3 -1
  144. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.cjs.map +1 -0
  145. package/lib-commonjs/components/ToggleButton/{ToggleButton.js → ToggleButton.cjs} +3 -3
  146. package/lib-commonjs/components/ToggleButton/{ToggleButton.js.map → ToggleButton.cjs.map} +1 -1
  147. package/lib-commonjs/components/ToggleButton/ToggleButton.types.cjs.map +1 -0
  148. package/lib-commonjs/components/ToggleButton/{index.js → index.cjs} +5 -6
  149. package/lib-commonjs/components/ToggleButton/index.cjs.map +1 -0
  150. package/lib-commonjs/components/ToggleButton/{renderToggleButton.js → renderToggleButton.cjs} +1 -1
  151. package/lib-commonjs/components/ToggleButton/{renderToggleButton.js.map → renderToggleButton.cjs.map} +1 -1
  152. package/lib-commonjs/components/ToggleButton/useToggleButton.cjs +31 -0
  153. package/lib-commonjs/components/ToggleButton/useToggleButton.cjs.map +1 -0
  154. package/lib-commonjs/components/ToggleButton/{useToggleButtonStyles.styles.js → useToggleButtonStyles.styles.cjs} +119 -5
  155. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.cjs.map +1 -0
  156. package/lib-commonjs/components/ToggleButton/{useToggleButtonStyles.styles.raw.js → useToggleButtonStyles.styles.raw.cjs} +51 -6
  157. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.cjs.map +1 -0
  158. package/lib-commonjs/contexts/ButtonContext.cjs.map +1 -0
  159. package/lib-commonjs/contexts/{index.js → index.cjs} +1 -1
  160. package/lib-commonjs/contexts/{index.js.map → index.cjs.map} +1 -1
  161. package/lib-commonjs/{index.js → index.cjs} +7 -13
  162. package/lib-commonjs/index.cjs.map +1 -0
  163. package/lib-commonjs/utils/{index.js → index.cjs} +1 -1
  164. package/lib-commonjs/utils/{index.js.map → index.cjs.map} +1 -1
  165. package/lib-commonjs/utils/{useToggleState.js → useToggleState.cjs} +2 -1
  166. package/lib-commonjs/utils/useToggleState.cjs.map +1 -0
  167. package/package.json +20 -14
  168. package/lib/components/Button/useButtonBase.js +0 -34
  169. package/lib/components/Button/useButtonBase.js.map +0 -1
  170. package/lib/components/CompoundButton/useCompoundButtonBase.js +0 -31
  171. package/lib/components/CompoundButton/useCompoundButtonBase.js.map +0 -1
  172. package/lib/components/MenuButton/useMenuButtonBase.js +0 -27
  173. package/lib/components/MenuButton/useMenuButtonBase.js.map +0 -1
  174. package/lib/components/SplitButton/useSplitButtonBase.js +0 -57
  175. package/lib/components/SplitButton/useSplitButtonBase.js.map +0 -1
  176. package/lib/components/ToggleButton/useToggleButtonBase.js +0 -13
  177. package/lib/components/ToggleButton/useToggleButtonBase.js.map +0 -1
  178. package/lib-commonjs/CompoundButton.js.map +0 -1
  179. package/lib-commonjs/SplitButton.js.map +0 -1
  180. package/lib-commonjs/components/Button/index.js.map +0 -1
  181. package/lib-commonjs/components/Button/renderButton.js.map +0 -1
  182. package/lib-commonjs/components/Button/useButton.js +0 -27
  183. package/lib-commonjs/components/Button/useButton.js.map +0 -1
  184. package/lib-commonjs/components/Button/useButtonBase.js +0 -41
  185. package/lib-commonjs/components/Button/useButtonBase.js.map +0 -1
  186. package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +0 -1
  187. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +0 -1
  188. package/lib-commonjs/components/CompoundButton/index.js.map +0 -1
  189. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +0 -26
  190. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +0 -1
  191. package/lib-commonjs/components/CompoundButton/useCompoundButtonBase.js.map +0 -1
  192. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +0 -1
  193. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +0 -1
  194. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +0 -1
  195. package/lib-commonjs/components/MenuButton/index.js.map +0 -1
  196. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +0 -1
  197. package/lib-commonjs/components/MenuButton/useMenuButton.js +0 -32
  198. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +0 -1
  199. package/lib-commonjs/components/MenuButton/useMenuButtonBase.js +0 -36
  200. package/lib-commonjs/components/MenuButton/useMenuButtonBase.js.map +0 -1
  201. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +0 -1
  202. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.js.map +0 -1
  203. package/lib-commonjs/components/SplitButton/SplitButton.js.map +0 -1
  204. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +0 -1
  205. package/lib-commonjs/components/SplitButton/index.js.map +0 -1
  206. package/lib-commonjs/components/SplitButton/useSplitButton.js +0 -36
  207. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +0 -1
  208. package/lib-commonjs/components/SplitButton/useSplitButtonBase.js.map +0 -1
  209. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +0 -1
  210. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +0 -1
  211. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +0 -4
  212. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +0 -1
  213. package/lib-commonjs/components/ToggleButton/index.js.map +0 -1
  214. package/lib-commonjs/components/ToggleButton/useToggleButton.js +0 -27
  215. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +0 -1
  216. package/lib-commonjs/components/ToggleButton/useToggleButtonBase.js +0 -19
  217. package/lib-commonjs/components/ToggleButton/useToggleButtonBase.js.map +0 -1
  218. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +0 -1
  219. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +0 -1
  220. package/lib-commonjs/contexts/ButtonContext.js.map +0 -1
  221. package/lib-commonjs/index.js.map +0 -1
  222. package/lib-commonjs/utils/useToggleState.js.map +0 -1
  223. /package/lib-commonjs/components/Button/{Button.types.js → Button.types.cjs} +0 -0
  224. /package/lib-commonjs/components/Button/{renderButton.js → renderButton.cjs} +0 -0
  225. /package/lib-commonjs/components/CompoundButton/{CompoundButton.types.js → CompoundButton.types.cjs} +0 -0
  226. /package/lib-commonjs/components/CompoundButton/{renderCompoundButton.js → renderCompoundButton.cjs} +0 -0
  227. /package/lib-commonjs/components/CompoundButton/{renderCompoundButton.js.map → renderCompoundButton.cjs.map} +0 -0
  228. /package/lib-commonjs/components/MenuButton/{renderMenuButton.js → renderMenuButton.cjs} +0 -0
  229. /package/lib-commonjs/components/{MenuButton/MenuButton.types.js → SplitButton/SplitButton.types.cjs} +0 -0
  230. /package/lib-commonjs/components/SplitButton/{renderSplitButton.js → renderSplitButton.cjs} +0 -0
  231. /package/lib-commonjs/components/SplitButton/{renderSplitButton.js.map → renderSplitButton.cjs.map} +0 -0
  232. /package/lib-commonjs/components/{SplitButton/SplitButton.types.js → ToggleButton/ToggleButton.types.cjs} +0 -0
  233. /package/lib-commonjs/contexts/{ButtonContext.js → ButtonContext.cjs} +0 -0
@@ -18,7 +18,7 @@ _export(exports, {
18
18
  }
19
19
  });
20
20
  const _react = require("@griffel/react");
21
- const _useButtonStylesstyles = require("../Button/useButtonStyles.styles");
21
+ const _useButtonStylesstyles = require("../Button/useButtonStyles.styles.cjs");
22
22
  const toggleButtonClassNames = {
23
23
  root: 'fui-ToggleButton',
24
24
  icon: 'fui-ToggleButton__icon'
@@ -460,6 +460,117 @@ const useRootCheckedStyles = /*#__PURE__*/ (0, _react.__styles)({
460
460
  ]
461
461
  ]
462
462
  });
463
+ const useCheckedAccessibleStyles = /*#__PURE__*/ (0, _react.__styles)({
464
+ base: {
465
+ De3pzq: "ffp7eso",
466
+ g2u3we: "f1p3nwhy",
467
+ h3c5rm: [
468
+ "f11589ue",
469
+ "f1pdflbu"
470
+ ],
471
+ B9xav0g: "f1q5o8ev",
472
+ zhjwy3: [
473
+ "f1pdflbu",
474
+ "f11589ue"
475
+ ],
476
+ sj55zd: "f1phragk",
477
+ Jwef8y: "f15wkkf3",
478
+ Bgoe8wy: "f1s2uweq",
479
+ Bwzppfd: [
480
+ "fr80ssc",
481
+ "fecsdlb"
482
+ ],
483
+ oetu4i: "f1ukrpxl",
484
+ gg5e9n: [
485
+ "fecsdlb",
486
+ "fr80ssc"
487
+ ],
488
+ Bi91k9c: "f1rq72xc",
489
+ Bpjbzib: "f1ksv2xa",
490
+ im15vp: "fhvnf4x",
491
+ Hjvxdg: [
492
+ "fb6swo4",
493
+ "f232fm2"
494
+ ],
495
+ Gpfmf1: "f1klyf7k",
496
+ ustxxc: [
497
+ "f232fm2",
498
+ "fb6swo4"
499
+ ],
500
+ Brsut9c: "f1d6mv4x"
501
+ },
502
+ outline: {
503
+ B4j52fo: "f192inf7",
504
+ Bekrc4i: [
505
+ "f5tn483",
506
+ "f1ojsxk5"
507
+ ],
508
+ Bn0qgzm: "f1vxd6vx",
509
+ ibv6hh: [
510
+ "f1ojsxk5",
511
+ "f5tn483"
512
+ ]
513
+ },
514
+ primary: {
515
+ Bw0xxkn: 0,
516
+ oeaueh: 0,
517
+ Bpd4iqm: 0,
518
+ Befb4lg: "f12rpxh0",
519
+ Dhobit: "f10okvgz",
520
+ Bfpq7zp: 0,
521
+ g9k6zt: 0,
522
+ Bn4voq9: 0,
523
+ giviqs: "f40way",
524
+ Bpkdmpa: "ftbw7yw"
525
+ },
526
+ subtle: {
527
+ ysa4qo: "f17xzaca"
528
+ },
529
+ transparent: {},
530
+ secondary: {}
531
+ }, {
532
+ d: [
533
+ ".ffp7eso{background-color:var(--colorBrandBackground);}",
534
+ ".f1p3nwhy{border-top-color:transparent;}",
535
+ ".f11589ue{border-right-color:transparent;}",
536
+ ".f1pdflbu{border-left-color:transparent;}",
537
+ ".f1q5o8ev{border-bottom-color:transparent;}",
538
+ ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}",
539
+ ".f192inf7{border-top-width:var(--strokeWidthThin);}",
540
+ ".f5tn483{border-right-width:var(--strokeWidthThin);}",
541
+ ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}",
542
+ ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}",
543
+ [
544
+ ".f12rpxh0{outline:var(--strokeWidthThin) solid var(--colorNeutralForegroundOnBrand);}",
545
+ {
546
+ p: -1
547
+ }
548
+ ],
549
+ ".f10okvgz{outline-offset:calc(var(--strokeWidthThicker) * -1);}",
550
+ [
551
+ ".f40way[data-fui-focus-visible]{outline:var(--strokeWidthThin) solid var(--colorNeutralForegroundOnBrand);}",
552
+ {
553
+ p: -1
554
+ }
555
+ ],
556
+ ".ftbw7yw[data-fui-focus-visible]{outline-offset:calc(var(--strokeWidthThickest) * -1);}"
557
+ ],
558
+ h: [
559
+ ".f15wkkf3:hover{background-color:var(--colorBrandBackgroundHover);}",
560
+ ".f1s2uweq:hover{border-top-color:transparent;}",
561
+ ".fr80ssc:hover{border-right-color:transparent;}",
562
+ ".fecsdlb:hover{border-left-color:transparent;}",
563
+ ".f1ukrpxl:hover{border-bottom-color:transparent;}",
564
+ ".f1rq72xc:hover{color:var(--colorNeutralForegroundOnBrand);}",
565
+ ".f1ksv2xa:hover:active,.f1ksv2xa:active:focus-visible{background-color:var(--colorBrandBackgroundPressed);}",
566
+ ".fhvnf4x:hover:active,.fhvnf4x:active:focus-visible{border-top-color:transparent;}",
567
+ ".fb6swo4:hover:active,.fb6swo4:active:focus-visible{border-right-color:transparent;}",
568
+ ".f232fm2:hover:active,.f232fm2:active:focus-visible{border-left-color:transparent;}",
569
+ ".f1klyf7k:hover:active,.f1klyf7k:active:focus-visible{border-bottom-color:transparent;}",
570
+ ".f1d6mv4x:hover:active,.f1d6mv4x:active:focus-visible{color:var(--colorNeutralForegroundOnBrand);}",
571
+ ".f17xzaca:hover .fui-ToggleButton__icon{color:var(--colorNeutralForegroundOnBrand);}"
572
+ ]
573
+ });
463
574
  const useRootDisabledStyles = /*#__PURE__*/ (0, _react.__styles)({
464
575
  base: {
465
576
  De3pzq: "f1bg9a2p",
@@ -784,19 +895,22 @@ const usePrimaryHighContrastStyles = /*#__PURE__*/ (0, _react.__styles)({
784
895
  ]
785
896
  });
786
897
  const useToggleButtonStyles_unstable = (state)=>{
787
- 'use no memo';
788
898
  const rootCheckedStyles = useRootCheckedStyles();
899
+ const accessibleCheckedStyles = useCheckedAccessibleStyles();
789
900
  const rootDisabledStyles = useRootDisabledStyles();
790
901
  const iconCheckedStyles = useIconCheckedStyles();
791
902
  const primaryHighContrastStyles = usePrimaryHighContrastStyles();
792
- const { appearance, checked, disabled, disabledFocusable } = state;
903
+ const { appearance, checked, disabled, disabledFocusable, isAccessible } = state;
904
+ // eslint-disable-next-line react-hooks/immutability
793
905
  state.root.className = (0, _react.mergeClasses)(toggleButtonClassNames.root, // Primary high contrast styles
794
906
  appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, // Checked styles
795
- checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], // Disabled styles
907
+ checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], // Opt-in accessible checked styles
908
+ isAccessible && checked && accessibleCheckedStyles.base, isAccessible && appearance && checked && accessibleCheckedStyles[appearance], // Disabled styles
796
909
  (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], // User provided class name
797
910
  state.root.className);
798
911
  if (state.icon) {
799
- state.icon.className = (0, _react.mergeClasses)(toggleButtonClassNames.icon, checked && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);
912
+ // eslint-disable-next-line react-hooks/immutability
913
+ state.icon.className = (0, _react.mergeClasses)(toggleButtonClassNames.icon, checked && !isAccessible && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);
800
914
  }
801
915
  (0, _useButtonStylesstyles.useButtonStyles_unstable)(state);
802
916
  return state;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useToggleButtonStyles.styles.js"],"sourcesContent":["'use client';\nimport { iconFilledClassName, iconRegularClassName } from \"@fluentui/react-icons\";\nimport { createCustomFocusIndicatorStyle } from \"@fluentui/react-tabster\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { shorthands, mergeClasses, makeStyles } from \"@griffel/react\";\nimport { useButtonStyles_unstable } from \"../Button/useButtonStyles.styles.js\";\nexport const toggleButtonClassNames = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon'\n};\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n [`& .${iconFilledClassName}`]: {\n display: 'inline'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none'\n },\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed\n }\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':focus': {\n border: '1px solid HighlightText',\n outlineColor: 'Highlight'\n }\n }\n },\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed\n },\n ...createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralStroke1)\n })\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Pressed\n }\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed\n }\n }\n});\nconst useCheckedAccessibleStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorBrandBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n // Appearance variations\n outline: {\n // There's no longer a reason to thicken the outline variant's border\n ...shorthands.borderWidth(tokens.strokeWidthThin)\n },\n primary: {\n // primary has an inner stroke for the checked style\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForegroundOnBrand}`,\n outlineOffset: `calc(${tokens.strokeWidthThicker} * -1)`,\n // need to not have the default focus style that removes the outline\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForegroundOnBrand}`,\n outlineOffset: `calc(${tokens.strokeWidthThickest} * -1)`\n })\n },\n subtle: {\n // override subtle-appearance-specific icon color on hover\n ':hover': {\n [`& .${toggleButtonClassNames.icon}`]: {\n color: tokens.colorNeutralForegroundOnBrand\n }\n }\n },\n transparent: {\n },\n secondary: {\n }\n});\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n ':hover': {\n ...shorthands.borderColor('transparent')\n },\n ':hover:active,:active:focus-visible': {\n ...shorthands.borderColor('transparent')\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent')\n }\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\n },\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent')\n }\n }\n});\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations with isAccessible=false\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n }\n});\nconst usePrimaryHighContrastStyles = makeStyles({\n // Do not use primary variant high contrast styles for toggle buttons\n // otherwise there isn't enough difference between on/off states\n base: {\n '@media (forced-colors: active)': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('ButtonBorder'),\n color: 'ButtonText',\n forcedColorAdjust: 'auto'\n }\n },\n disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n ':focus': {\n ...shorthands.borderColor('GrayText')\n }\n }\n }\n});\nexport const useToggleButtonStyles_unstable = (state)=>{\n const rootCheckedStyles = useRootCheckedStyles();\n const accessibleCheckedStyles = useCheckedAccessibleStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n const { appearance, checked, disabled, disabledFocusable, isAccessible } = state;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(toggleButtonClassNames.root, // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, // Checked styles\n checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], // Opt-in accessible checked styles\n isAccessible && checked && accessibleCheckedStyles.base, isAccessible && appearance && checked && accessibleCheckedStyles[appearance], // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], // User provided class name\n state.root.className);\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(toggleButtonClassNames.icon, checked && !isAccessible && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);\n }\n useButtonStyles_unstable(state);\n return state;\n};\n"],"names":["iconFilledClassName","iconRegularClassName","createCustomFocusIndicatorStyle","tokens","shorthands","mergeClasses","__styles","useButtonStyles_unstable","toggleButtonClassNames","root","icon","useRootCheckedStyles","base","De3pzq","g2u3we","h3c5rm","B9xav0g","zhjwy3","sj55zd","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","D0sxk3","t6yez3","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Bi91k9c","Bpjbzib","im15vp","Hjvxdg","Gpfmf1","ustxxc","Brsut9c","highContrast","By8wz76","Bcq6wej","Jcjdmf","sc4o1m","Bosien3","B7iucu3","B8gzw0y","Bbkh6qg","F230oe","Bdw8ktp","Bj1xduy","Bhh2cfd","Bahaeuw","Bv2bamp","vxuvv6","Bli9q98","Bx2tt8t","yad0b3","j2fop7","B6rz4yo","Buk7464","Bqg8rp8","pjr8j7","Bgs2klq","Hwei09","Bi9aqk7","Fihjvf","nhyz0p","Buw724y","Bn7qjfh","B0u7xl9","md97jv","h3ptyc","s1kvfj","kogrdj","dqx2i2","o0nolc","outline","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","primary","secondary","subtle","transparent","d","h","m","p","useCheckedAccessibleStyles","Bw0xxkn","oeaueh","Bpd4iqm","Befb4lg","Dhobit","Bfpq7zp","g9k6zt","Bn4voq9","giviqs","Bpkdmpa","ysa4qo","useRootDisabledStyles","useIconCheckedStyles","subtleOrTransparent","usePrimaryHighContrastStyles","disabled","useToggleButtonStyles_unstable","state","rootCheckedStyles","accessibleCheckedStyles","rootDisabledStyles","iconCheckedStyles","primaryHighContrastStyles","appearance","checked","disabledFocusable","isAccessible","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAMCQ,sBAAsB;;;IAwPtBiG,8BAA8B;;;;uBA1PU,gBAAgB;uCAC5B,qCAAqC;AACvE,+BAA+B;IAClChG,IAAI,EAAE,kBAAkB;IACxBC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,GAAA,WAAA,OAAGL,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,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F,IAAI,EAAEqG,OAAO,IAAIN,iBAAiB,CAACtE,YAAY,EAAE2E,UAAU,IAAIC,OAAO,IAAIN,iBAAiB,CAACK,UAAU,CAAC,EAAE,mCAAA;IACtIG,YAAY,IAAIF,OAAO,IAAIL,uBAAuB,CAAChG,IAAI,EAAEuG,YAAY,IAAIH,UAAU,IAAIC,OAAO,IAAIL,uBAAuB,CAACI,UAAU,CAAC,EAAE,AACvI,kBADuI;KACtIR,QAAQ,IAAIU,iBAAAA,CAAiB,IAAKL,kBAAkB,CAACjG,IAAI,EAAEoG,UAAU,KAAKR,QAAQ,IAAIU,iBAAAA,CAAiB,CAAC,GAAIL,kBAAkB,CAACG,UAAU,CAAC,EAAE,2BAAA;IAC7IN,KAAK,CAACjG,IAAI,CAAC2G,SAAS,CAAC;IACrB,IAAIV,KAAK,CAAChG,IAAI,EAAE;QACZ,oDAAA;QACAgG,KAAK,CAAChG,IAAI,CAAC0G,SAAS,OAAG/G,mBAAY,EAACG,sBAAsB,CAACE,IAAI,EAAEuG,OAAO,IAAI,CAACE,YAAY,KAAKH,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,aAAA,CAAa,CAAC,GAAIF,iBAAiB,CAACR,mBAAmB,EAAEQ,iBAAiB,CAACzE,YAAY,EAAEqE,KAAK,CAAChG,IAAI,CAAC0G,SAAS,CAAC;IAC1P;QACA7G,+CAAwB,EAACmG,KAAK,CAAC;IAC/B,OAAOA,KAAK;AAChB,CAAC"}
@@ -21,7 +21,7 @@ const _reacticons = require("@fluentui/react-icons");
21
21
  const _reacttabster = require("@fluentui/react-tabster");
22
22
  const _reacttheme = require("@fluentui/react-theme");
23
23
  const _react = require("@griffel/react");
24
- const _useButtonStylesstyles = require("../Button/useButtonStyles.styles");
24
+ const _useButtonStylesstyles = require("../Button/useButtonStyles.styles.cjs");
25
25
  const toggleButtonClassNames = {
26
26
  root: 'fui-ToggleButton',
27
27
  icon: 'fui-ToggleButton__icon'
@@ -135,6 +135,49 @@ const useRootCheckedStyles = (0, _react.makeStyles)({
135
135
  }
136
136
  }
137
137
  });
138
+ const useCheckedAccessibleStyles = (0, _react.makeStyles)({
139
+ // Base styles
140
+ base: {
141
+ backgroundColor: _reacttheme.tokens.colorBrandBackground,
142
+ ..._react.shorthands.borderColor('transparent'),
143
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand,
144
+ ':hover': {
145
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundHover,
146
+ ..._react.shorthands.borderColor('transparent'),
147
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
148
+ },
149
+ ':hover:active,:active:focus-visible': {
150
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundPressed,
151
+ ..._react.shorthands.borderColor('transparent'),
152
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
153
+ }
154
+ },
155
+ // Appearance variations
156
+ outline: {
157
+ // There's no longer a reason to thicken the outline variant's border
158
+ ..._react.shorthands.borderWidth(_reacttheme.tokens.strokeWidthThin)
159
+ },
160
+ primary: {
161
+ // primary has an inner stroke for the checked style
162
+ outline: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralForegroundOnBrand}`,
163
+ outlineOffset: `calc(${_reacttheme.tokens.strokeWidthThicker} * -1)`,
164
+ // need to not have the default focus style that removes the outline
165
+ ...(0, _reacttabster.createCustomFocusIndicatorStyle)({
166
+ outline: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralForegroundOnBrand}`,
167
+ outlineOffset: `calc(${_reacttheme.tokens.strokeWidthThickest} * -1)`
168
+ })
169
+ },
170
+ subtle: {
171
+ // override subtle-appearance-specific icon color on hover
172
+ ':hover': {
173
+ [`& .${toggleButtonClassNames.icon}`]: {
174
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
175
+ }
176
+ }
177
+ },
178
+ transparent: {},
179
+ secondary: {}
180
+ });
138
181
  const useRootDisabledStyles = (0, _react.makeStyles)({
139
182
  // Base styles
140
183
  base: {
@@ -190,7 +233,7 @@ const useRootDisabledStyles = (0, _react.makeStyles)({
190
233
  }
191
234
  });
192
235
  const useIconCheckedStyles = (0, _react.makeStyles)({
193
- // Appearance variations
236
+ // Appearance variations with isAccessible=false
194
237
  subtleOrTransparent: {
195
238
  color: _reacttheme.tokens.colorNeutralForeground2BrandSelected
196
239
  },
@@ -223,15 +266,17 @@ const usePrimaryHighContrastStyles = (0, _react.makeStyles)({
223
266
  }
224
267
  });
225
268
  const useToggleButtonStyles_unstable = (state)=>{
226
- 'use no memo';
227
269
  const rootCheckedStyles = useRootCheckedStyles();
270
+ const accessibleCheckedStyles = useCheckedAccessibleStyles();
228
271
  const rootDisabledStyles = useRootDisabledStyles();
229
272
  const iconCheckedStyles = useIconCheckedStyles();
230
273
  const primaryHighContrastStyles = usePrimaryHighContrastStyles();
231
- const { appearance, checked, disabled, disabledFocusable } = state;
232
- state.root.className = (0, _react.mergeClasses)(toggleButtonClassNames.root, appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], state.root.className);
274
+ const { appearance, checked, disabled, disabledFocusable, isAccessible } = state;
275
+ // eslint-disable-next-line react-hooks/immutability
276
+ state.root.className = (0, _react.mergeClasses)(toggleButtonClassNames.root, appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], isAccessible && checked && accessibleCheckedStyles.base, isAccessible && appearance && checked && accessibleCheckedStyles[appearance], (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], state.root.className);
233
277
  if (state.icon) {
234
- state.icon.className = (0, _react.mergeClasses)(toggleButtonClassNames.icon, checked && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);
278
+ // eslint-disable-next-line react-hooks/immutability
279
+ state.icon.className = (0, _react.mergeClasses)(toggleButtonClassNames.icon, checked && !isAccessible && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);
235
280
  }
236
281
  (0, _useButtonStylesstyles.useButtonStyles_unstable)(state);
237
282
  return state;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ToggleButton/useToggleButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots } from '../Button/Button.types';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nexport const toggleButtonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon',\n};\n\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n\n ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':focus': {\n border: '1px solid HighlightText',\n outlineColor: 'Highlight',\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n\n ...createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n }),\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\nconst useCheckedAccessibleStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorBrandBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n // Appearance variations\n outline: {\n // There's no longer a reason to thicken the outline variant's border\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n\n primary: {\n // primary has an inner stroke for the checked style\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForegroundOnBrand}`,\n outlineOffset: `calc(${tokens.strokeWidthThicker} * -1)`,\n\n // need to not have the default focus style that removes the outline\n ...createCustomFocusIndicatorStyle({\n outline: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForegroundOnBrand}`,\n outlineOffset: `calc(${tokens.strokeWidthThickest} * -1)`,\n }),\n },\n\n subtle: {\n // override subtle-appearance-specific icon color on hover\n ':hover': {\n [`& .${toggleButtonClassNames.icon}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n\n transparent: {\n /* No styles */\n },\n\n secondary: {\n /* No styles */\n },\n});\n\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active,:active:focus-visible': {\n ...shorthands.borderColor('transparent'),\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active,:active:focus-visible': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations with isAccessible=false\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto',\n },\n },\n});\n\nconst usePrimaryHighContrastStyles = makeStyles({\n // Do not use primary variant high contrast styles for toggle buttons\n // otherwise there isn't enough difference between on/off states\n base: {\n '@media (forced-colors: active)': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('ButtonBorder'),\n color: 'ButtonText',\n forcedColorAdjust: 'auto',\n },\n },\n\n disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n\n ':focus': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n },\n});\n\nexport const useToggleButtonStyles_unstable = (state: ToggleButtonState): ToggleButtonState => {\n const rootCheckedStyles = useRootCheckedStyles();\n const accessibleCheckedStyles = useCheckedAccessibleStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n\n const { appearance, checked, disabled, disabledFocusable, isAccessible } = state;\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n toggleButtonClassNames.root,\n\n // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base,\n appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled,\n\n // Checked styles\n checked && rootCheckedStyles.base,\n checked && rootCheckedStyles.highContrast,\n appearance && checked && rootCheckedStyles[appearance],\n\n // Opt-in accessible checked styles\n isAccessible && checked && accessibleCheckedStyles.base,\n isAccessible && appearance && checked && accessibleCheckedStyles[appearance],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base,\n appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(\n toggleButtonClassNames.icon,\n checked &&\n !isAccessible &&\n (appearance === 'subtle' || appearance === 'transparent') &&\n iconCheckedStyles.subtleOrTransparent,\n iconCheckedStyles.highContrast,\n state.icon.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["iconFilledClassName","iconRegularClassName","createCustomFocusIndicatorStyle","tokens","shorthands","mergeClasses","makeStyles","useButtonStyles_unstable","toggleButtonClassNames","root","icon","useRootCheckedStyles","base","backgroundColor","colorNeutralBackground1Selected","borderColor","colorNeutralStroke1","color","colorNeutralForeground1Selected","borderWidth","strokeWidthThin","display","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralForeground1Hover","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","colorNeutralForeground1Pressed","highContrast","forcedColorAdjust","border","outlineColor","outline","colorTransparentBackgroundSelected","strokeWidthThicker","colorTransparentBackgroundHover","colorTransparentBackgroundPressed","primary","colorBrandBackgroundSelected","colorNeutralForegroundOnBrand","colorBrandBackgroundHover","colorBrandBackgroundPressed","secondary","subtle","colorSubtleBackgroundSelected","colorNeutralForeground2Selected","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","transparent","colorNeutralForeground2BrandSelected","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","useCheckedAccessibleStyles","colorBrandBackground","outlineOffset","strokeWidthThickest","useRootDisabledStyles","colorNeutralBackgroundDisabled","colorNeutralStrokeDisabled","colorNeutralForegroundDisabled","colorTransparentBackground","useIconCheckedStyles","subtleOrTransparent","usePrimaryHighContrastStyles","disabled","useToggleButtonStyles_unstable","state","rootCheckedStyles","accessibleCheckedStyles","rootDisabledStyles","iconCheckedStyles","primaryHighContrastStyles","appearance","checked","disabledFocusable","isAccessible","className"],"mappings":"AAAA;;;;;;;;;;;;0BAWaQ;;;IAwSA2D,8BAAAA;;;;4BAjT6C,wBAAwB;8BAClC,0BAA0B;4BACnD,wBAAwB;uBACM,iBAAiB;uCAC7B,sCAAmC;AAKrE,MAAM3D,yBAAsD;IACjEC,MAAM;IACN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,eAAe,aAAA,CAAY,IACvDF,kBAAkBR,mBAAmB,EACvCQ,kBAAkB5C,YAAY,EAC9BwC,MAAM1D,IAAI,CAACoE,SAAS;IAExB;QAEAvE,+CAAAA,EAAyB6D;IAEzB,OAAOA;AACT,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contexts/ButtonContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * Internal context value used to update default values between internal components\n *\n * @internal\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * Internal context provider used to update default values between internal components\n *\n * @internal\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * Internal context hook used to update default values between internal components\n *\n * @internal\n */\nexport const useButtonContext = (): ButtonContextValue => {\n return React.useContext(buttonContext) ?? buttonContextDefaultValue;\n};\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":"AAAA;;;;;;;;;;;;yBAuBaK;;;oBAOAE;;;;;iEA5BU,QAAQ;AAG/B,MAAMN,8BAAgBD,OAAME,aAAa,CAAiCC;AAW1E,MAAMC,4BAAgD,CAAC;AAOhD,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;AAOrD,MAAMC,mBAAmB;QACvBP;IAAP,OAAOA,CAAAA,oBAAAA,OAAMQ,UAAU,CAACP,cAAAA,MAAAA,QAAjBD,sBAAAA,KAAAA,IAAAA,oBAAmCI;AAC5C,EAAE"}
@@ -16,4 +16,4 @@ _export(exports, {
16
16
  return _ButtonContext.useButtonContext;
17
17
  }
18
18
  });
19
- const _ButtonContext = require("./ButtonContext");
19
+ const _ButtonContext = require("./ButtonContext.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { ButtonContextValue } from './ButtonContext';\nexport { ButtonContextProvider, useButtonContext } from './ButtonContext';\n"],"names":["ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;;eACSA,oCAAqB;;;eAAEC,+BAAgB;;;+BAAQ,kBAAkB"}
1
+ {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { ButtonContextValue } from './ButtonContext';\nexport { ButtonContextProvider, useButtonContext } from './ButtonContext';\n"],"names":["ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;;eACSA,oCAAqB;;;eAAEC,+BAAgB;;;+BAAQ,qBAAkB"}
@@ -69,9 +69,6 @@ _export(exports, {
69
69
  useButton_unstable: function() {
70
70
  return _Button.useButton_unstable;
71
71
  },
72
- useCompoundButtonBase_unstable: function() {
73
- return _CompoundButton.useCompoundButtonBase_unstable;
74
- },
75
72
  useCompoundButtonStyles_unstable: function() {
76
73
  return _CompoundButton.useCompoundButtonStyles_unstable;
77
74
  },
@@ -87,9 +84,6 @@ _export(exports, {
87
84
  useMenuButton_unstable: function() {
88
85
  return _MenuButton.useMenuButton_unstable;
89
86
  },
90
- useSplitButtonBase_unstable: function() {
91
- return _SplitButton.useSplitButtonBase_unstable;
92
- },
93
87
  useSplitButtonStyles_unstable: function() {
94
88
  return _SplitButton.useSplitButtonStyles_unstable;
95
89
  },
@@ -109,10 +103,10 @@ _export(exports, {
109
103
  return _index.useToggleState;
110
104
  }
111
105
  });
112
- const _Button = require("./Button");
113
- const _CompoundButton = require("./CompoundButton");
114
- const _MenuButton = require("./MenuButton");
115
- const _SplitButton = require("./SplitButton");
116
- const _ToggleButton = require("./ToggleButton");
117
- const _index = require("./utils/index");
118
- const _index1 = require("./contexts/index");
106
+ const _Button = require("./Button.cjs");
107
+ const _CompoundButton = require("./CompoundButton.cjs");
108
+ const _MenuButton = require("./MenuButton.cjs");
109
+ const _SplitButton = require("./SplitButton.cjs");
110
+ const _ToggleButton = require("./ToggleButton.cjs");
111
+ const _index = require("./utils/index.cjs");
112
+ const _index1 = require("./contexts/index.cjs");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Button,\n buttonClassNames,\n renderButton_unstable,\n useButtonStyles_unstable,\n useButton_unstable,\n useButtonBase_unstable,\n} from './Button';\nexport type { ButtonProps, ButtonSlots, ButtonState, ButtonBaseProps, ButtonBaseState } from './Button';\nexport {\n CompoundButton,\n compoundButtonClassNames,\n renderCompoundButton_unstable,\n useCompoundButtonStyles_unstable,\n useCompoundButton_unstable,\n} from './CompoundButton';\nexport type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';\nexport {\n MenuButton,\n menuButtonClassNames,\n renderMenuButton_unstable,\n useMenuButtonStyles_unstable,\n useMenuButton_unstable,\n useMenuButtonBase_unstable,\n} from './MenuButton';\nexport type {\n MenuButtonProps,\n MenuButtonSlots,\n MenuButtonState,\n MenuButtonBaseProps,\n MenuButtonBaseState,\n} from './MenuButton';\nexport {\n SplitButton,\n renderSplitButton_unstable,\n splitButtonClassNames,\n useSplitButtonStyles_unstable,\n useSplitButton_unstable,\n} from './SplitButton';\nexport type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';\nexport {\n ToggleButton,\n renderToggleButton_unstable,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n useToggleButtonBase_unstable,\n} from './ToggleButton';\nexport type {\n ToggleButtonProps,\n ToggleButtonState,\n ToggleButtonBaseProps,\n ToggleButtonBaseState,\n} from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n\nexport { ButtonContextProvider, useButtonContext } from './contexts/index';\nexport type { ButtonContextValue } from './contexts/index';\n"],"names":["Button","buttonClassNames","renderButton_unstable","useButtonStyles_unstable","useButton_unstable","useButtonBase_unstable","CompoundButton","compoundButtonClassNames","renderCompoundButton_unstable","useCompoundButtonStyles_unstable","useCompoundButton_unstable","MenuButton","menuButtonClassNames","renderMenuButton_unstable","useMenuButtonStyles_unstable","useMenuButton_unstable","useMenuButtonBase_unstable","SplitButton","renderSplitButton_unstable","splitButtonClassNames","useSplitButtonStyles_unstable","useSplitButton_unstable","ToggleButton","renderToggleButton_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable","useToggleButton_unstable","useToggleButtonBase_unstable","useToggleState","ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;IACEA;6BAAM;;yBAwDsB;eAArB6B;;;eA/CPvB,8BAAc;;;eAQdK,sBAAU;;;eAeVM,wBAAW;;gBAQC;eAAZK;;;eAvCArB,wBAAgB;;;eAShBM,wCAAwB;;;eAQxBK,gCAAoB;;;eAhBpBV,6BAAqB;;;eASrBM,6CAA6B;;;eAQ7BK,qCAAyB;;;eAczBK,uCAA0B;;IAQ1BK,2BAA2B;;;IAP3BJ,qBAAqB;;;0BAQC;eAAtBK;;;eArCAnB,8BAAsB;;oBAmDwB;eAAhByB;;;eArD9B3B,gCAAwB;;;eACxBC,0BAAkB;;;eAQlBK,gDAAgC;;;eAChCC,0CAA0B;;;eAS1BM,sCAA0B;;;eAF1BF,wCAA4B;;;eAC5BC,kCAAsB;;;eActBK,0CAA6B;;;eAC7BC,oCAAuB;;;eASvBM,0CAA4B;;;eAF5BF,4CAA8B;;;eAC9BC,sCAAwB;;;eAUjBE,qBAAc;;;wBAhDhB,cAAW;gCAQX,sBAAmB;4BASnB,kBAAe;6BAcf,mBAAgB;8BAShB,oBAAiB;uBAQO,mBAAgB;wBAES,sBAAmB"}
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "useToggleState", {
8
8
  return _useToggleState.useToggleState;
9
9
  }
10
10
  });
11
- const _useToggleState = require("./useToggleState");
11
+ const _useToggleState = require("./useToggleState.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { useToggleState } from './useToggleState';\n"],"names":["useToggleState"],"mappings":";;;;;;;eAASA,8BAAc;;;gCAAQ,mBAAmB"}
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { useToggleState } from './useToggleState';\n"],"names":["useToggleState"],"mappings":";;;;;;;eAASA,8BAAc;;;gCAAQ,sBAAmB"}
@@ -13,7 +13,7 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
13
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
14
  const _reactutilities = require("@fluentui/react-utilities");
15
15
  function useToggleState(props, state) {
16
- const { checked, defaultChecked, disabled, disabledFocusable } = props;
16
+ const { checked, defaultChecked, disabled, disabledFocusable, isAccessible = false } = props;
17
17
  const { onClick, role } = state.root;
18
18
  const [checkedValue, setCheckedValue] = (0, _reactutilities.useControllableState)({
19
19
  state: checked,
@@ -37,6 +37,7 @@ function useToggleState(props, state) {
37
37
  return {
38
38
  ...state,
39
39
  checked: checkedValue,
40
+ isAccessible,
40
41
  root: {
41
42
  ...state.root,
42
43
  [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/useToggleState.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<\n ToggleButtonProps,\n 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable' | 'isAccessible'\n >,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root' | 'isAccessible'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable, isAccessible = false } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n isAccessible,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","isAccessible","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"mappings":"AAAA;;;;;+BAOgBI;;;;;;;iEALO,QAAQ;gCACwC,4BAA4B;AAI5F,wBAOLC,KAAyB,EAAEC,KAAmB;IAC9C,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,eAAe,KAAK,EAAE,GAAGN;IACvF,MAAM,EAAEO,OAAO,EAAEC,IAAI,EAAE,GAAGP,MAAMQ,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,OAAGd,oCAAAA,EAAqB;QAC3DI,OAAOC;QACPU,cAAcT;QACdU,cAAc;IAChB;IAEA,MAAMC,qBAAqBN,SAAS,sBAAsBA,SAAS;IAEnE,MAAMO,gBAAgBpB,OAAMqB,WAAW,CACrC,CAACC;QACC,IAAI,CAACb,YAAY,CAACC,mBAAmB;YACnC,IAAIY,GAAGC,gBAAgB,EAAE;gBACvB;YACF;YAEAP,gBAAgB,CAACD;QACnB;IACF,GACA;QAACA;QAAcN;QAAUC;QAAmBM;KAAgB;IAG9D,OAAO;QACL,GAAGV,KAAK;QAERC,SAASQ;QAETJ;QAEAG,MAAM;YACJ,GAAGR,MAAMQ,IAAI;YACb,CAACK,qBAAqB,iBAAiB,eAAe,EAAEJ;YACxDH,aAAST,gCAAAA,MACPF,8BAAAA,EAAeW,SAA2EQ;QAE9F;IACF;AACF"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
3
+ "version": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
4
4
  "description": "Fluent UI React Button component.",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
@@ -12,14 +12,14 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui/keyboard-keys": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
16
- "@fluentui/react-aria": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
15
+ "@fluentui/keyboard-keys": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
16
+ "@fluentui/react-aria": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
17
17
  "@fluentui/react-icons": "^2.0.245",
18
- "@fluentui/react-jsx-runtime": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
19
- "@fluentui/react-shared-contexts": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
20
- "@fluentui/react-tabster": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
21
- "@fluentui/react-theme": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
22
- "@fluentui/react-utilities": "9.72.9-experimental.component-base-hooks.20260122-49fc330360.0",
18
+ "@fluentui/react-jsx-runtime": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
19
+ "@fluentui/react-shared-contexts": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
20
+ "@fluentui/react-tabster": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
21
+ "@fluentui/react-theme": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
22
+ "@fluentui/react-utilities": "9.74.3-experimental.esm.20260709-49ee7a20cf.0",
23
23
  "@griffel/react": "^1.5.32",
24
24
  "@swc/helpers": "^0.5.1"
25
25
  },
@@ -32,17 +32,23 @@
32
32
  "beachball": {},
33
33
  "exports": {
34
34
  ".": {
35
- "types": "./dist/index.d.ts",
36
- "node": "./lib-commonjs/index.js",
37
- "import": "./lib/index.js",
38
- "require": "./lib-commonjs/index.js"
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./lib/index.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.cts",
41
+ "default": "./lib-commonjs/index.cjs"
42
+ }
39
43
  },
40
44
  "./package.json": "./package.json"
41
45
  },
42
46
  "files": [
43
47
  "*.md",
44
48
  "dist/*.d.ts",
49
+ "dist/*.d.cts",
45
50
  "lib",
46
51
  "lib-commonjs"
47
- ]
52
+ ],
53
+ "type": "module"
48
54
  }
@@ -1,34 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { useARIAButtonProps } from '@fluentui/react-aria';
4
- import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
5
- /**
6
- * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
7
- * @param props - User provided props to the Button component.
8
- * @param ref - User provided ref to be passed to the Button component.
9
- */ export const useButtonBase_unstable = (props, ref)=>{
10
- const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;
11
- const iconShorthand = slot.optional(icon, {
12
- elementType: 'span'
13
- });
14
- return {
15
- // Props passed at the top-level
16
- disabled,
17
- disabledFocusable,
18
- iconPosition,
19
- iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
20
- // Slots definition
21
- components: {
22
- root: 'button',
23
- icon: 'span'
24
- },
25
- root: slot.always(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {
26
- elementType: 'button',
27
- defaultProps: {
28
- ref: ref,
29
- type: as === 'button' ? 'button' : undefined
30
- }
31
- }),
32
- icon: iconShorthand
33
- };
34
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Button/useButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ButtonBaseProps, ButtonBaseState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButtonBase_unstable = (\n props: ButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonBaseState => {\n const { as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before' } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n return {\n // Props passed at the top-level\n disabled,\n disabledFocusable,\n iconPosition,\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n // Slots definition\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: as === 'button' ? 'button' : undefined,\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonProps","getIntrinsicElementProps","slot","useButtonBase_unstable","props","ref","as","disabled","disabledFocusable","icon","iconPosition","iconShorthand","optional","elementType","iconOnly","Boolean","children","components","root","always","defaultProps","type","undefined"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAA8BC,kBAAkB,QAAQ,uBAAuB;AAC/E,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;;;CAIC,GACD,OAAO,MAAMC,yBAAyB,CACpCC,OACAC;IAEA,MAAM,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAE,GAAGN;IACtG,MAAMO,gBAAgBT,KAAKU,QAAQ,CAACH,MAAM;QAAEI,aAAa;IAAO;IAChE,OAAO;QACL,gCAAgC;QAChCN;QACAC;QACAE;QACAI,UAAUC,QAAQJ,CAAAA,0BAAAA,oCAAAA,cAAeK,QAAQ,KAAI,CAACZ,MAAMY,QAAQ;QAC5D,mBAAmB;QACnBC,YAAY;YAAEC,MAAM;YAAUT,MAAM;QAAO;QAC3CS,MAAMhB,KAAKiB,MAAM,CAA2BlB,yBAAyBK,IAAIN,mBAAmBI,MAAME,EAAE,EAAEF,SAAS;YAC7GS,aAAa;YACbO,cAAc;gBACZf,KAAKA;gBACLgB,MAAMf,OAAO,WAAW,WAAWgB;YACrC;QACF;QACAb,MAAME;IACR;AACF,EAAE"}
@@ -1,31 +0,0 @@
1
- 'use client';
2
- import * as React from 'react';
3
- import { slot } from '@fluentui/react-utilities';
4
- import { useButtonBase_unstable } from '../Button/index';
5
- /**
6
- * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
7
- * @param props - User provided props to the CompoundButton component.
8
- * @param ref - User provided ref to be passed to the CompoundButton component.
9
- */ export const useCompoundButtonBase_unstable = ({ contentContainer, secondaryContent, ...props }, ref)=>{
10
- var _state_icon, _state_secondaryContent;
11
- const state = {
12
- // Button state
13
- ...useButtonBase_unstable(props, ref),
14
- // Slots definition
15
- components: {
16
- root: 'button',
17
- icon: 'span',
18
- contentContainer: 'span',
19
- secondaryContent: 'span'
20
- },
21
- contentContainer: slot.always(contentContainer, {
22
- elementType: 'span'
23
- }),
24
- secondaryContent: slot.optional(secondaryContent, {
25
- elementType: 'span'
26
- })
27
- };
28
- // Recalculate iconOnly to take into account secondaryContent.
29
- state.iconOnly = Boolean(((_state_icon = state.icon) === null || _state_icon === void 0 ? void 0 : _state_icon.children) && !props.children && !((_state_secondaryContent = state.secondaryContent) === null || _state_secondaryContent === void 0 ? void 0 : _state_secondaryContent.children));
30
- return state;
31
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/CompoundButton/useCompoundButtonBase.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useButtonBase_unstable } from '../Button/index';\nimport type { CompoundButtonBaseProps, CompoundButtonBaseState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButtonBase_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonBaseState => {\n const state: CompoundButtonBaseState = {\n // Button state\n ...useButtonBase_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: slot.always(contentContainer, { elementType: 'span' }),\n secondaryContent: slot.optional(secondaryContent, { elementType: 'span' }),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"names":["React","slot","useButtonBase_unstable","useCompoundButtonBase_unstable","contentContainer","secondaryContent","props","ref","state","components","root","icon","always","elementType","optional","iconOnly","Boolean","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,sBAAsB,QAAQ,kBAAkB;AAGzD;;;;CAIC,GACD,OAAO,MAAMC,iCAAiC,CAC5C,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAE,GAAGC,OAAgC,EACzEC;QAkByBC,aAA4CA;IAhBrE,MAAMA,QAAiC;QACrC,eAAe;QACf,GAAGN,uBAAuBI,OAAOC,IAAI;QAErC,mBAAmB;QACnBE,YAAY;YACVC,MAAM;YACNC,MAAM;YACNP,kBAAkB;YAClBC,kBAAkB;QACpB;QACAD,kBAAkBH,KAAKW,MAAM,CAACR,kBAAkB;YAAES,aAAa;QAAO;QACtER,kBAAkBJ,KAAKa,QAAQ,CAACT,kBAAkB;YAAEQ,aAAa;QAAO;IAC1E;IAEA,8DAA8D;IAC9DL,MAAMO,QAAQ,GAAGC,QAAQR,EAAAA,cAAAA,MAAMG,IAAI,cAAVH,kCAAAA,YAAYS,QAAQ,KAAI,CAACX,MAAMW,QAAQ,IAAI,GAACT,0BAAAA,MAAMH,gBAAgB,cAAtBG,8CAAAA,wBAAwBS,QAAQ;IAErG,OAAOT;AACT,EAAE"}