@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
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Button = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var renderButton_1 = /*#__PURE__*/require("./renderButton");
10
+ const renderButton_1 = /*#__PURE__*/require("./renderButton");
11
11
 
12
- var useButton_1 = /*#__PURE__*/require("./useButton");
12
+ const useButton_1 = /*#__PURE__*/require("./useButton");
13
13
 
14
- var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
14
+ const useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
15
15
  /**
16
16
  * Buttons give people a way to trigger an action.
17
17
  */
18
18
 
19
19
 
20
- exports.Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = useButton_1.useButton(props, ref);
22
- useButtonStyles_1.useButtonStyles(state);
23
- return renderButton_1.renderButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
20
+ exports.Button = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useButton_1.useButton_unstable(props, ref);
22
+ useButtonStyles_1.useButtonStyles_unstable(state);
23
+ return renderButton_1.renderButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
24
24
  });
25
25
  exports.Button.displayName = 'Button';
26
26
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,IAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,MAAA,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClF,MAAM,KAAK,GAAG,WAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,CAAd;AAEA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,cAAA,CAAA,YAAA,CAAa,KAAb,CAAP,CALkF,CAMlF;AACD,CAPuD,CAA3C;AASb,OAAA,CAAA,MAAA,CAAO,WAAP,GAAqB,QAArB","sourceRoot":""}
1
+ {"version":3,"sources":["components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,MAAA,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAAd;AAEA,EAAA,iBAAA,CAAA,wBAAA,CAAyB,KAAzB;AAEA,SAAO,cAAA,CAAA,qBAAA,CAAsB,KAAtB,CAAP,CALsF,CAMtF;AACD,CAPuD,CAA3C;AASb,OAAA,CAAA,MAAA,CAAO,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -3,24 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useButtonStyles = void 0;
6
+ exports.useButtonStyles_unstable = exports.buttonClassNames = 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("./Button"), exports);
11
11
 
12
- tslib_1.__exportStar(require("./Button.types"), exports);
13
-
14
12
  tslib_1.__exportStar(require("./renderButton"), exports);
15
13
 
16
14
  tslib_1.__exportStar(require("./useButton"), exports);
17
15
 
18
16
  var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
19
17
 
20
- Object.defineProperty(exports, "useButtonStyles", {
18
+ Object.defineProperty(exports, "buttonClassNames", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return useButtonStyles_1.buttonClassNames;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "useButtonStyles_unstable", {
21
25
  enumerable: true,
22
26
  get: function () {
23
- return useButtonStyles_1.useButtonStyles;
27
+ return useButtonStyles_1.useButtonStyles_unstable;
24
28
  }
25
29
  });
26
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,eAAA;AAAe;AAAf,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/Button/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AAGA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,gBAAA;AAAgB;AAAhB,CAAA;AAAkB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA","sourcesContent":["export * from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -3,27 +3,30 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderButton = void 0;
6
+ exports.renderButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
11
  /**
14
12
  * Renders a Button component by passing the state defined props to the appropriate slots.
15
13
  */
16
14
 
17
15
 
18
- var renderButton = function (state) {
19
- var _a = react_utilities_1.getSlots(state, ['root', 'icon']),
20
- slots = _a.slots,
21
- slotProps = _a.slotProps;
22
-
23
- var iconOnly = state.iconOnly,
24
- iconPosition = state.iconPosition;
25
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), iconPosition !== 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && state.root.children, iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
16
+ const renderButton_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ const {
22
+ iconOnly,
23
+ iconPosition
24
+ } = state;
25
+ return React.createElement(slots.root, { ...slotProps.root
26
+ }, iconPosition !== 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
27
+ }), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
28
+ }));
26
29
  };
27
30
 
28
- exports.renderButton = renderButton;
31
+ exports.renderButton_unstable = renderButton_unstable;
29
32
  //# sourceMappingURL=renderButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,YAAY,GAAG,UAAC,KAAD,EAAmB;AACvC,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAsB,KAAtB,EAA6B,CAAC,MAAD,EAAS,MAAT,CAA7B,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;A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,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAD7C,EAEG,CAAC,QAAD,IAAa,KAAK,CAAC,IAAN,CAAW,QAF3B,EAGG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,IAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAH7C,CADF;AAOD,CAXM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonState) => {\n const { slots, slotProps } = getSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useButton = void 0;
6
+ exports.useButton_unstable = void 0;
7
7
 
8
- var react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
8
+ const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
9
9
 
10
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
  /**
12
12
  * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
13
13
  * @param props - User provided props to the Button component.
@@ -15,32 +15,26 @@ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
15
15
  */
16
16
 
17
17
 
18
- var useButton = function (props, ref) {
19
- var appearance = props.appearance,
20
- as = props.as,
21
- _a = props.block,
22
- block = _a === void 0 ? false : _a,
23
- _b = props.disabled,
24
- disabled = _b === void 0 ? false : _b,
25
- _c = props.disabledFocusable,
26
- disabledFocusable = _c === void 0 ? false : _c,
27
- icon = props.icon,
28
- _d = props.iconPosition,
29
- iconPosition = _d === void 0 ? 'before' : _d,
30
- _e = props.shape,
31
- shape = _e === void 0 ? 'rounded' : _e,
32
- _f = props.size,
33
- size = _f === void 0 ? 'medium' : _f;
34
- var iconShorthand = react_utilities_1.resolveShorthand(icon);
18
+ const useButton_unstable = (props, ref) => {
19
+ const {
20
+ appearance = 'secondary',
21
+ as,
22
+ disabled = false,
23
+ disabledFocusable = false,
24
+ icon,
25
+ iconPosition = 'before',
26
+ shape = 'rounded',
27
+ size = 'medium'
28
+ } = props;
29
+ const iconShorthand = react_utilities_1.resolveShorthand(icon);
35
30
  return {
36
31
  // Props passed at the top-level
37
- appearance: appearance,
38
- block: block,
39
- disabled: disabled,
40
- disabledFocusable: disabledFocusable,
41
- iconPosition: iconPosition,
42
- shape: shape,
43
- size: size,
32
+ appearance,
33
+ disabled,
34
+ disabledFocusable,
35
+ iconPosition,
36
+ shape,
37
+ size,
44
38
  // State calculated from a set of props
45
39
  iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
46
40
  // Slots definition
@@ -53,12 +47,13 @@ var useButton = function (props, ref) {
53
47
  defaultProps: {
54
48
  // useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>
55
49
  ref: ref,
56
- type: 'button'
50
+ type: 'button' // This is added because the default for type is 'submit'
51
+
57
52
  }
58
53
  })),
59
54
  icon: iconShorthand
60
55
  };
61
56
  };
62
57
 
63
- exports.useButton = useButton;
58
+ exports.useButton_unstable = useButton_unstable;
64
59
  //# sourceMappingURL=useButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Button/useButton.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,YAAA,gBAAA,OAAA,CAA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;AAGL,IAAA,QAHK;AAIL,IAAA,iBAJK;AAKL,IAAA,YALK;AAML,IAAA,KANK;AAOL,IAAA,IAPK;AASL;AACA,IAAA,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAA,aAAa,CAAE,QAAf,KAA2B,CAAC,KAAK,CAAC,QAAnC,CAVZ;AAYL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE;AAFI,KAbP;AAkBL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CACJ,EAAE,IAAI,QADF,EAEJ,YAAA,CAAA,aAAA,CAAmC,KAAnC,EAA0C;AACxC,MAAA,QAAQ,EAAE,IAD8B;AAExC,MAAA,YAAY,EAAE;AACZ;AACA,QAAA,GAAG,EAAE,GAFO;AAGZ,QAAA,IAAI,EAAE,QAHM,CAGI;;AAHJ;AAF0B,KAA1C,CAFI,CAlBD;AA6BL,IAAA,IAAI,EAAE;AA7BD,GAAP;AA+BD,CA/CM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import * as React from 'react';\nimport { useARIAButton } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ButtonProps, ButtonState } 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 useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const {\n appearance = 'secondary',\n as,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = 'medium',\n } = props;\n const iconShorthand = resolveShorthand(icon);\n\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n },\n\n root: getNativeElementProps(\n as || 'button',\n useARIAButton<ARIAButtonSlotProps>(props, {\n required: true,\n defaultProps: {\n // useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>\n ref: ref as React.Ref<HTMLButtonElement>,\n type: 'button', // This is added because the default for type is 'submit'\n },\n }),\n ),\n icon: iconShorthand,\n };\n};\n"],"sourceRoot":"../src/"}