@fluentui/react-button 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. package/CHANGELOG.json +914 -24
  2. package/CHANGELOG.md +388 -180
  3. package/README.md +80 -18
  4. package/dist/{react-button.d.ts → index.d.ts} +72 -59
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/Button.js.map +1 -1
  7. package/lib/CompoundButton.js.map +1 -1
  8. package/lib/MenuButton.js.map +1 -1
  9. package/lib/SplitButton.js.map +1 -1
  10. package/lib/ToggleButton.js.map +1 -1
  11. package/lib/components/Button/Button.js +7 -7
  12. package/lib/components/Button/Button.js.map +1 -1
  13. package/lib/components/Button/Button.types.js.map +1 -1
  14. package/lib/components/Button/index.js +1 -2
  15. package/lib/components/Button/index.js.map +1 -1
  16. package/lib/components/Button/renderButton.js +13 -9
  17. package/lib/components/Button/renderButton.js.map +1 -1
  18. package/lib/components/Button/useButton.js +20 -25
  19. package/lib/components/Button/useButton.js.map +1 -1
  20. package/lib/components/Button/useButtonStyles.js +240 -165
  21. package/lib/components/Button/useButtonStyles.js.map +1 -1
  22. package/lib/components/CompoundButton/CompoundButton.js +7 -7
  23. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  24. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  25. package/lib/components/CompoundButton/index.js +1 -1
  26. package/lib/components/CompoundButton/index.js.map +1 -1
  27. package/lib/components/CompoundButton/renderCompoundButton.js +15 -9
  28. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  29. package/lib/components/CompoundButton/useCompoundButton.js +13 -8
  30. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  31. package/lib/components/CompoundButton/useCompoundButtonStyles.js +96 -75
  32. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  33. package/lib/components/MenuButton/MenuButton.js +9 -8
  34. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  35. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  36. package/lib/components/MenuButton/index.js +1 -1
  37. package/lib/components/MenuButton/index.js.map +1 -1
  38. package/lib/components/MenuButton/renderMenuButton.js +13 -9
  39. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  40. package/lib/components/MenuButton/useMenuButton.js +11 -11
  41. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  42. package/lib/components/MenuButton/useMenuButtonStyles.js +39 -17
  43. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  44. package/lib/components/SplitButton/SplitButton.js +8 -8
  45. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  46. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  47. package/lib/components/SplitButton/index.js +1 -1
  48. package/lib/components/SplitButton/index.js.map +1 -1
  49. package/lib/components/SplitButton/renderSplitButton.js +9 -7
  50. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  51. package/lib/components/SplitButton/useSplitButton.js +54 -49
  52. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  53. package/lib/components/SplitButton/useSplitButtonStyles.js +46 -39
  54. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  55. package/lib/components/ToggleButton/ToggleButton.js +7 -7
  56. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  57. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  58. package/lib/components/ToggleButton/index.js +1 -1
  59. package/lib/components/ToggleButton/index.js.map +1 -1
  60. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  61. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  62. package/lib/components/ToggleButton/useToggleButton.js +5 -41
  63. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  64. package/lib/components/ToggleButton/useToggleButtonStyles.js +110 -86
  65. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  66. package/lib/index.js +6 -5
  67. package/lib/index.js.map +1 -1
  68. package/lib/utils/index.js +2 -0
  69. package/lib/utils/index.js.map +1 -0
  70. package/lib/utils/useToggleState.js +37 -0
  71. package/lib/utils/useToggleState.js.map +1 -0
  72. package/lib-commonjs/Button.js +1 -1
  73. package/lib-commonjs/Button.js.map +1 -1
  74. package/lib-commonjs/CompoundButton.js +1 -1
  75. package/lib-commonjs/CompoundButton.js.map +1 -1
  76. package/lib-commonjs/MenuButton.js +1 -1
  77. package/lib-commonjs/MenuButton.js.map +1 -1
  78. package/lib-commonjs/SplitButton.js +1 -1
  79. package/lib-commonjs/SplitButton.js.map +1 -1
  80. package/lib-commonjs/ToggleButton.js +1 -1
  81. package/lib-commonjs/ToggleButton.js.map +1 -1
  82. package/lib-commonjs/components/Button/Button.js +8 -8
  83. package/lib-commonjs/components/Button/Button.js.map +1 -1
  84. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  85. package/lib-commonjs/components/Button/index.js +10 -6
  86. package/lib-commonjs/components/Button/index.js.map +1 -1
  87. package/lib-commonjs/components/Button/renderButton.js +17 -14
  88. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  89. package/lib-commonjs/components/Button/useButton.js +24 -29
  90. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  91. package/lib-commonjs/components/Button/useButtonStyles.js +243 -166
  92. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  93. package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
  94. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  95. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  96. package/lib-commonjs/components/CompoundButton/index.js +10 -4
  97. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  98. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +19 -14
  99. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  100. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +16 -12
  101. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  102. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +99 -77
  103. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  104. package/lib-commonjs/components/MenuButton/MenuButton.js +10 -9
  105. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  106. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  107. package/lib-commonjs/components/MenuButton/index.js +10 -4
  108. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  109. package/lib-commonjs/components/MenuButton/renderMenuButton.js +17 -14
  110. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  111. package/lib-commonjs/components/MenuButton/useMenuButton.js +15 -16
  112. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  113. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +43 -19
  114. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  115. package/lib-commonjs/components/SplitButton/SplitButton.js +9 -9
  116. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  117. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  118. package/lib-commonjs/components/SplitButton/index.js +10 -4
  119. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  120. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -12
  121. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  122. package/lib-commonjs/components/SplitButton/useSplitButton.js +58 -54
  123. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  124. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +50 -42
  125. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  126. package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
  127. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  128. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  129. package/lib-commonjs/components/ToggleButton/index.js +10 -4
  130. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  131. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
  132. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  133. package/lib-commonjs/components/ToggleButton/useToggleButton.js +7 -45
  134. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  135. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +114 -86
  136. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  137. package/lib-commonjs/index.js +169 -6
  138. package/lib-commonjs/index.js.map +1 -1
  139. package/lib-commonjs/utils/index.js +10 -0
  140. package/lib-commonjs/utils/index.js.map +1 -0
  141. package/lib-commonjs/utils/useToggleState.js +48 -0
  142. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  143. package/package.json +22 -27
  144. package/dist/demo/index.html +0 -71
  145. package/dist/demo/react-dom.development.js +0 -21413
  146. package/dist/demo/react.development.js +0 -3155
  147. package/lib/Button.d.ts +0 -1
  148. package/lib/CompoundButton.d.ts +0 -1
  149. package/lib/MenuButton.d.ts +0 -1
  150. package/lib/SplitButton.d.ts +0 -1
  151. package/lib/ToggleButton.d.ts +0 -1
  152. package/lib/common/isConformant.d.ts +0 -4
  153. package/lib/common/isConformant.js +0 -13
  154. package/lib/common/isConformant.js.map +0 -1
  155. package/lib/components/Button/Button.d.ts +0 -6
  156. package/lib/components/Button/Button.types.d.ts +0 -62
  157. package/lib/components/Button/index.d.ts +0 -5
  158. package/lib/components/Button/renderButton.d.ts +0 -5
  159. package/lib/components/Button/useButton.d.ts +0 -8
  160. package/lib/components/Button/useButtonStyles.d.ts +0 -10
  161. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  162. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  163. package/lib/components/CompoundButton/index.d.ts +0 -5
  164. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  165. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  166. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  167. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  168. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -11
  169. package/lib/components/MenuButton/index.d.ts +0 -5
  170. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  171. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  172. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  173. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  174. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -19
  175. package/lib/components/SplitButton/index.d.ts +0 -5
  176. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  177. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  178. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  179. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  180. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  181. package/lib/components/ToggleButton/index.d.ts +0 -5
  182. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  183. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  184. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  185. package/lib/index.d.ts +0 -5
  186. package/lib-commonjs/Button.d.ts +0 -1
  187. package/lib-commonjs/CompoundButton.d.ts +0 -1
  188. package/lib-commonjs/MenuButton.d.ts +0 -1
  189. package/lib-commonjs/SplitButton.d.ts +0 -1
  190. package/lib-commonjs/ToggleButton.d.ts +0 -1
  191. package/lib-commonjs/common/isConformant.d.ts +0 -4
  192. package/lib-commonjs/common/isConformant.js +0 -24
  193. package/lib-commonjs/common/isConformant.js.map +0 -1
  194. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  195. package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
  196. package/lib-commonjs/components/Button/index.d.ts +0 -5
  197. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  198. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  199. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -10
  200. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  201. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  202. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  203. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  204. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  205. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  206. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  207. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -11
  208. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  209. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  210. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  211. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  212. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  213. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -19
  214. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  215. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  216. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  217. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  218. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  219. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  220. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  221. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  222. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  223. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  224. package/lib-commonjs/index.d.ts +0 -5
@@ -3,18 +3,21 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useSplitButtonStyles = void 0;
6
+ exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
10
+ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
11
11
 
12
- var SplitButtonClassNames = {
13
- primaryActionButton: 'SplitButton-primaryActionButton',
14
- menuButton: 'SplitButton-menuButton'
12
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
13
+
14
+ exports.splitButtonClassNames = {
15
+ root: 'fui-SplitButton',
16
+ menuButton: 'fui-SplitButton__menuButton',
17
+ primaryActionButton: 'fui-SplitButton__primaryActionButton'
15
18
  };
16
19
 
17
- var useFocusStyles = /*#__PURE__*/react_make_styles_1.__styles({
20
+ const useFocusStyles = /*#__PURE__*/react_1.__styles({
18
21
  "primaryActionButton": {
19
22
  "B486eqv": "f2hkw1w",
20
23
  "Bmrpcm6": ["fub8a6s", "f1g41uvt"],
@@ -31,70 +34,75 @@ var useFocusStyles = /*#__PURE__*/react_make_styles_1.__styles({
31
34
  "d": ["[data-keyboard-nav] .fub8a6s:focus{border-top-right-radius:0;}", "[data-keyboard-nav] .f1g41uvt:focus{border-top-left-radius:0;}", "[data-keyboard-nav] .f58hr3h:focus{border-bottom-right-radius:0;}", "[data-keyboard-nav] .f1u1mnrj:focus{border-bottom-left-radius:0;}", "[data-keyboard-nav] .fy9hclh:focus{border-left-width:0;}", "[data-keyboard-nav] .f549e1y:focus{border-right-width:0;}"]
32
35
  });
33
36
 
34
- var useRootStyles = /*#__PURE__*/react_make_styles_1.__styles({
37
+ const useRootStyles = /*#__PURE__*/react_1.__styles({
35
38
  "base": {
36
39
  "mc9l5x": "ftuwxu6",
37
40
  "Brf1p80": "fsxf2b5",
38
41
  "qhf8xq": "f10pi13n",
39
42
  "ha4doy": "fmrv4ls",
40
- "ipgm0c": ["f178uykt", "f90yzzo"],
41
- "B6cuk21": ["f1bxd3c5", "f1ekv84t"],
42
- "bajz6s": ["fnux5s6", "f5nfhee"],
43
- "Bzqncq": ["f19wc9x7", "f5bevrs"],
44
- "Flt4rd": ["f1wefiyg", "f1leuqsa"]
45
- },
46
- "block": {
47
- "a9b677": "fly5x3f"
43
+ "kn2xc0": ["f14uur2j", "fc1btbj"],
44
+ "Bs76p8a": ["fye5tvs", "fc597qq"],
45
+ "cuxpm9": ["f1e8brtx", "fr36rk3"],
46
+ "Biffepf": ["fxp12j1", "f1m6nt2y"],
47
+ "Defnvf": ["fr7y8no", "f1dn0c6m"],
48
+ "z0pv9t": "f1hvqvul"
48
49
  },
49
50
  "outline": {},
50
51
  "primary": {
51
- "Bxrr62k": ["f8z1slf", "f1qj10op"],
52
- "wqijrc": ["fmrqvvu", "fu0z9tm"],
53
- "Bsk9mq6": ["f1naws84", "f1ry7auu"]
52
+ "B1l9wao": ["f12j1tfo", "f1ufkr8r"],
53
+ "lcnrd8": ["f17lyyco", "f151o42i"],
54
+ "Brbpp8k": ["f1nb07eg", "fg8a8qi"]
54
55
  },
56
+ "secondary": {},
55
57
  "subtle": {
56
- "Bxrr62k": ["f1xobncs", "f1xirlzn"],
57
- "wqijrc": ["f1hmsn3f", "fi0rm9z"],
58
- "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
58
+ "B1l9wao": ["f1ysqkm5", "f10nbrj"],
59
+ "lcnrd8": ["fn44ryq", "fwhhltr"],
60
+ "Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
59
61
  },
60
62
  "transparent": {
61
- "Bxrr62k": ["f1xobncs", "f1xirlzn"],
62
- "wqijrc": ["f1hmsn3f", "fi0rm9z"],
63
- "Bsk9mq6": ["fam4u78", "f1hqq1j6"]
63
+ "B1l9wao": ["f1ysqkm5", "f10nbrj"],
64
+ "lcnrd8": ["fn44ryq", "fwhhltr"],
65
+ "Brbpp8k": ["fg8lp5p", "f1p6hj0a"]
64
66
  },
65
67
  "circular": {},
66
68
  "rounded": {},
67
69
  "square": {},
68
70
  "disabled": {
69
- "Bxrr62k": ["f11wzqjl", "f1a5dzic"],
70
- "wqijrc": ["fhk4lgh", "f1r7ztp2"],
71
- "Bsk9mq6": ["f1ot7jx6", "f1qvd61g"]
71
+ "B1l9wao": ["f10xrnr8", "f15nylwb"],
72
+ "lcnrd8": ["f11fwhjz", "f18vtcsx"],
73
+ "Brbpp8k": ["f31btwb", "fzgm9gq"]
74
+ },
75
+ "disabledHighContrast": {
76
+ "Bcsxniv": ["fj2q5vi", "f13tct40"],
77
+ "tl7e51": ["fb2mzc7", "f179dhpp"],
78
+ "mba178": ["f1ma39qa", "f1nzpdru"]
72
79
  }
73
80
  }, {
74
- "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f178uykt .SplitButton-primaryActionButton{border-top-right-radius:0;}", ".f90yzzo .SplitButton-primaryActionButton{border-top-left-radius:0;}", ".f1bxd3c5 .SplitButton-primaryActionButton{border-bottom-right-radius:0;}", ".f1ekv84t .SplitButton-primaryActionButton{border-bottom-left-radius:0;}", ".fnux5s6 .SplitButton-menuButton{border-left-width:0;}", ".f5nfhee .SplitButton-menuButton{border-right-width:0;}", ".f19wc9x7 .SplitButton-menuButton{border-top-left-radius:0;}", ".f5bevrs .SplitButton-menuButton{border-top-right-radius:0;}", ".f1wefiyg .SplitButton-menuButton{border-bottom-left-radius:0;}", ".f1leuqsa .SplitButton-menuButton{border-bottom-right-radius:0;}", ".fly5x3f{width:100%;}", ".f8z1slf .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1qj10op .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1xobncs .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1xirlzn .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11wzqjl .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1a5dzic .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
75
- "h": [".fmrqvvu:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fu0z9tm:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1hmsn3f:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fi0rm9z:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fhk4lgh:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1r7ztp2:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
76
- "a": [".f1naws84:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ry7auu:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fam4u78:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1hqq1j6:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1ot7jx6:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1qvd61g:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"]
81
+ "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".f14uur2j .fui-SplitButton__primaryActionButton{border-top-right-radius:0;}", ".fc1btbj .fui-SplitButton__primaryActionButton{border-top-left-radius:0;}", ".fye5tvs .fui-SplitButton__primaryActionButton{border-bottom-right-radius:0;}", ".fc597qq .fui-SplitButton__primaryActionButton{border-bottom-left-radius:0;}", ".f1e8brtx .fui-SplitButton__menuButton{border-left-width:0;}", ".fr36rk3 .fui-SplitButton__menuButton{border-right-width:0;}", ".fxp12j1 .fui-SplitButton__menuButton{border-top-left-radius:0;}", ".f1m6nt2y .fui-SplitButton__menuButton{border-top-right-radius:0;}", ".fr7y8no .fui-SplitButton__menuButton{border-bottom-left-radius:0;}", ".f1dn0c6m .fui-SplitButton__menuButton{border-bottom-right-radius:0;}", ".f1hvqvul .fui-SplitButton__menuButton{min-width:0;}", ".f12j1tfo .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ufkr8r .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1ysqkm5 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f10nbrj .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f10xrnr8 .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f15nylwb .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
82
+ "h": [".f17lyyco:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f151o42i:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1nb07eg:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fg8a8qi:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fn44ryq:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fwhhltr:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fg8lp5p:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1p6hj0a:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11fwhjz:hover .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f18vtcsx:hover .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f31btwb:hover:active .fui-SplitButton__primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fzgm9gq:hover:active .fui-SplitButton__primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
83
+ "t": ["@media (forced-colors: active){.fj2q5vi .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f13tct40 .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.fb2mzc7:hover .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f179dhpp:hover .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}", "@media (forced-colors: active){.f1ma39qa:hover:active .fui-SplitButton__primaryActionButton{border-right-color:GrayText;}.f1nzpdru:hover:active .fui-SplitButton__primaryActionButton{border-left-color:GrayText;}}"]
77
84
  });
78
85
 
79
- var useSplitButtonStyles = function (state) {
80
- var rootStyles = useRootStyles();
81
- var focusStyles = useFocusStyles();
82
- var appearance = state.appearance,
83
- block = state.block,
84
- disabled = state.disabled,
85
- disabledFocusable = state.disabledFocusable;
86
- state.root.className = react_make_styles_1.mergeClasses(rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
86
+ const useSplitButtonStyles_unstable = state => {
87
+ const rootStyles = useRootStyles();
88
+ const focusStyles = useFocusStyles();
89
+ const {
90
+ appearance,
91
+ disabled,
92
+ disabledFocusable
93
+ } = state;
94
+ state.root.className = react_1.mergeClasses(exports.splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);
87
95
 
88
96
  if (state.menuButton) {
89
- state.menuButton.className = react_make_styles_1.mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
97
+ state.menuButton.className = react_1.mergeClasses(exports.splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
90
98
  }
91
99
 
92
100
  if (state.primaryActionButton) {
93
- state.primaryActionButton.className = react_make_styles_1.mergeClasses(SplitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
101
+ state.primaryActionButton.className = react_1.mergeClasses(exports.splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
94
102
  }
95
103
 
96
104
  return state;
97
105
  };
98
106
 
99
- exports.useSplitButtonStyles = useSplitButtonStyles;
107
+ exports.useSplitButtonStyles_unstable = useSplitButtonStyles_unstable;
100
108
  //# sourceMappingURL=useSplitButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,mBAAmB,EAAE,iCADO;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,cAAc,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAvB;;AAaA,IAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAU,IAAI,UAAU,CAAC,UAAD,CAHH,EAIrB,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,QAJzB,EAKrB,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,oBALzB,EAMrB,KAAK,CAAC,IAAN,CAAW,SANU,CAAvB;;AASA,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,OAAA,CAAA,YAAA,CAC3B,OAAA,CAAA,qBAAA,CAAsB,UADK,EAE3B,WAAW,CAAC,UAFe,EAG3B,KAAK,CAAC,UAAN,CAAiB,SAHU,CAA7B;AAKD;;AAED,MAAI,KAAK,CAAC,mBAAV,EAA+B;AAC7B,IAAA,KAAK,CAAC,mBAAN,CAA0B,SAA1B,GAAsC,OAAA,CAAA,YAAA,CACpC,OAAA,CAAA,qBAAA,CAAsB,mBADc,EAEpC,WAAW,CAAC,mBAFwB,EAGpC,KAAK,CAAC,mBAAN,CAA0B,SAHU,CAAtC;AAKD;;AAED,SAAO,KAAP;AACD,CAhCM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\nexport const splitButtonClassNames: SlotClassNames<SplitButtonSlots> = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton',\n};\n\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n }),\n\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n});\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundInverted,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n },\n transparent: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n },\n\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n },\n },\n});\n\nexport const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitButtonState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n\n const { appearance, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n splitButtonClassNames.root,\n rootStyles.base,\n appearance && rootStyles[appearance],\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n state.root.className,\n );\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(\n splitButtonClassNames.menuButton,\n focusStyles.menuButton,\n state.menuButton.className,\n );\n }\n\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(\n splitButtonClassNames.primaryActionButton,\n focusStyles.primaryActionButton,\n state.primaryActionButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ToggleButton = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var renderToggleButton_1 = /*#__PURE__*/require("./renderToggleButton");
10
+ const renderToggleButton_1 = /*#__PURE__*/require("./renderToggleButton");
11
11
 
12
- var useToggleButton_1 = /*#__PURE__*/require("./useToggleButton");
12
+ const useToggleButton_1 = /*#__PURE__*/require("./useToggleButton");
13
13
 
14
- var useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
14
+ const useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
15
15
  /**
16
16
  * ToggleButtons are buttons that toggle between two defined states when triggered.
17
17
  */
18
18
 
19
19
 
20
- exports.ToggleButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = useToggleButton_1.useToggleButton(props, ref);
22
- useToggleButtonStyles_1.useToggleButtonStyles(state);
23
- return renderToggleButton_1.renderToggleButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
20
+ exports.ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useToggleButton_1.useToggleButton_unstable(props, ref);
22
+ useToggleButtonStyles_1.useToggleButtonStyles_unstable(state);
23
+ return renderToggleButton_1.renderToggleButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
24
24
  });
25
25
  exports.ToggleButton.displayName = 'ToggleButton';
26
26
  //# sourceMappingURL=ToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,YAAA,gBAAuD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,iBAAA,CAAA,eAAA,CAAgB,KAAhB,EAAuB,GAAvB,CAAd;AAEA,EAAA,uBAAA,CAAA,qBAAA,CAAsB,KAAtB;AAEA,SAAO,oBAAA,CAAA,kBAAA,CAAmB,KAAnB,CAAP,CAL8F,CAM9F;AACD,CAPmE,CAAvD;AASb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","sourceRoot":""}
1
+ {"version":3,"sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,YAAA,gBAAuD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,iBAAA,CAAA,wBAAA,CAAyB,KAAzB,EAAgC,GAAhC,CAAd;AAEA,EAAA,uBAAA,CAAA,8BAAA,CAA+B,KAA/B;AAEA,SAAO,oBAAA,CAAA,2BAAA,CAA4B,KAA5B,CAAP,CALkG,CAMlG;AACD,CAPmE,CAAvD;AASb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","sourcesContent":["import * as React from 'react';\nimport { renderToggleButton_unstable } from './renderToggleButton';\nimport { useToggleButton_unstable } from './useToggleButton';\nimport { useToggleButtonStyles_unstable } from './useToggleButtonStyles';\nimport type { ToggleButtonProps } from './ToggleButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * ToggleButtons are buttons that toggle between two defined states when triggered.\n */\nexport const ToggleButton: ForwardRefComponent<ToggleButtonProps> = React.forwardRef((props, ref) => {\n const state = useToggleButton_unstable(props, ref);\n\n useToggleButtonStyles_unstable(state);\n\n return renderToggleButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToggleButtonProps>;\n\nToggleButton.displayName = 'ToggleButton';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useToggleButtonStyles = void 0;
6
+ exports.useToggleButtonStyles_unstable = exports.toggleButtonClassNames = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
9
 
10
10
  tslib_1.__exportStar(require("./ToggleButton"), exports);
11
11
 
@@ -17,10 +17,16 @@ tslib_1.__exportStar(require("./useToggleButton"), exports);
17
17
 
18
18
  var useToggleButtonStyles_1 = /*#__PURE__*/require("./useToggleButtonStyles");
19
19
 
20
- Object.defineProperty(exports, "useToggleButtonStyles", {
20
+ Object.defineProperty(exports, "toggleButtonClassNames", {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return useToggleButtonStyles_1.useToggleButtonStyles;
23
+ return useToggleButtonStyles_1.toggleButtonClassNames;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "useToggleButtonStyles_unstable", {
27
+ enumerable: true,
28
+ get: function () {
29
+ return useToggleButtonStyles_1.useToggleButtonStyles_unstable;
24
30
  }
25
31
  });
26
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ToggleButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/ToggleButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AAAwB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,uBAAA,CAAA,8BAAA;AAA8B;AAA9B,CAAA","sourcesContent":["export * from './ToggleButton';\nexport * from './ToggleButton.types';\nexport * from './renderToggleButton';\nexport * from './useToggleButton';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderToggleButton = void 0;
6
+ exports.renderToggleButton_unstable = void 0;
7
7
 
8
8
  var renderButton_1 = /*#__PURE__*/require("../Button/renderButton");
9
9
 
10
- Object.defineProperty(exports, "renderToggleButton", {
10
+ Object.defineProperty(exports, "renderToggleButton_unstable", {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return renderButton_1.renderButton;
13
+ return renderButton_1.renderButton_unstable;
14
14
  }
15
15
  });
16
16
  //# sourceMappingURL=renderToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,YAAA;AAAY;AAAZ,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA","sourcesContent":["export { renderButton_unstable as renderToggleButton_unstable } from '../Button/renderButton';\n"],"sourceRoot":"../src/"}
@@ -3,15 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useToggleButton = void 0;
6
+ exports.useToggleButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const useToggleState_1 = /*#__PURE__*/require("../../utils/useToggleState");
9
9
 
10
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
- var React = /*#__PURE__*/require("react");
13
-
14
- var useButton_1 = /*#__PURE__*/require("../Button/useButton");
10
+ const useButton_1 = /*#__PURE__*/require("../Button/useButton");
15
11
  /**
16
12
  * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
17
13
  * processed state.
@@ -20,44 +16,10 @@ var useButton_1 = /*#__PURE__*/require("../Button/useButton");
20
16
  */
21
17
 
22
18
 
23
- var useToggleButton = function (_a, ref) {
24
- var _b;
25
-
26
- var checked = _a.checked,
27
- defaultChecked = _a.defaultChecked,
28
- props = tslib_1.__rest(_a, ["checked", "defaultChecked"]);
29
-
30
- var buttonState = useButton_1.useButton(props, ref);
31
- var _c = buttonState.root,
32
- role = _c.role,
33
- onClick = _c.onClick;
34
-
35
- var _d = react_utilities_1.useControllableState({
36
- state: checked,
37
- defaultState: defaultChecked,
38
- initialState: false
39
- }),
40
- checkedValue = _d[0],
41
- setCheckedValue = _d[1];
42
-
43
- var isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
44
- return tslib_1.__assign(tslib_1.__assign({}, buttonState), {
45
- // State calculated from a set of props
46
- checked: checkedValue,
47
- // Slots definition
48
- root: tslib_1.__assign(tslib_1.__assign({}, buttonState.root), (_b = {}, _b[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = !!checkedValue, _b.onClick = React.useCallback(function (ev) {
49
- if (onClick) {
50
- onClick(ev);
51
-
52
- if (ev.defaultPrevented) {
53
- return;
54
- }
55
- }
56
-
57
- setCheckedValue(!checkedValue);
58
- }, [checkedValue, setCheckedValue, onClick]), _b))
59
- });
19
+ const useToggleButton_unstable = (props, ref) => {
20
+ const buttonState = useButton_1.useButton_unstable(props, ref);
21
+ return useToggleState_1.useToggleState(props, buttonState);
60
22
  };
61
23
 
62
- exports.useToggleButton = useToggleButton;
24
+ exports.useToggleButton_unstable = useToggleButton_unstable;
63
25
  //# sourceMappingURL=useToggleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,iBAAA,gBA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AH,GAAoB,cADpB,CAAA,GACqC,CAAC,CAAC,YADvC,EAEnB,EAAA,CAAA,OAAA,GAAS,KAAK,CAAC,WAAN,CACP,UAAA,EAAA,EAAE;AACA,UAAI,OAAJ,EAAa;AACX,QAAA,OAAO,CAAC,EAAD,CAAP;;AAEA,YAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;AACF;;AAED,MAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD,KAXM,EAYP,CAAC,YAAD,EAAe,eAAf,EAAgC,OAAhC,CAZO,CAFU,EAelB,EAhBC;AANU,GAFhB,CAAA;AA2BD,CA1CM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
1
+ {"version":3,"sources":["components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;AAKG;;;AACI,MAAM,wBAAwB,GAAG,CACtC,KADsC,EAEtC,GAFsC,KAGjB;AACrB,QAAM,WAAW,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAApB;AAEA,SAAO,gBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,WAAtB,CAAP;AACD,CAPM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButton_unstable } from '../Button/useButton';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToggleButton_unstable = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const buttonState = useButton_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"sourceRoot":"../src/"}