@fluentui/react-button 0.0.0-nightly-20220302-0405.1

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 (226) hide show
  1. package/CHANGELOG.json +4894 -0
  2. package/CHANGELOG.md +1817 -0
  3. package/LICENSE +15 -0
  4. package/README.md +36 -0
  5. package/dist/demo/index.html +71 -0
  6. package/dist/demo/react-dom.development.js +21413 -0
  7. package/dist/demo/react.development.js +3155 -0
  8. package/dist/react-button.d.ts +240 -0
  9. package/lib/Button.d.ts +1 -0
  10. package/lib/Button.js +2 -0
  11. package/lib/Button.js.map +1 -0
  12. package/lib/CompoundButton.d.ts +1 -0
  13. package/lib/CompoundButton.js +2 -0
  14. package/lib/CompoundButton.js.map +1 -0
  15. package/lib/MenuButton.d.ts +1 -0
  16. package/lib/MenuButton.js +2 -0
  17. package/lib/MenuButton.js.map +1 -0
  18. package/lib/SplitButton.d.ts +1 -0
  19. package/lib/SplitButton.js +2 -0
  20. package/lib/SplitButton.js.map +1 -0
  21. package/lib/ToggleButton.d.ts +1 -0
  22. package/lib/ToggleButton.js +2 -0
  23. package/lib/ToggleButton.js.map +1 -0
  24. package/lib/components/Button/Button.d.ts +6 -0
  25. package/lib/components/Button/Button.js +15 -0
  26. package/lib/components/Button/Button.js.map +1 -0
  27. package/lib/components/Button/Button.types.d.ts +62 -0
  28. package/lib/components/Button/Button.types.js +2 -0
  29. package/lib/components/Button/Button.types.js.map +1 -0
  30. package/lib/components/Button/index.d.ts +5 -0
  31. package/lib/components/Button/index.js +5 -0
  32. package/lib/components/Button/index.js.map +1 -0
  33. package/lib/components/Button/renderButton.d.ts +5 -0
  34. package/lib/components/Button/renderButton.js +21 -0
  35. package/lib/components/Button/renderButton.js.map +1 -0
  36. package/lib/components/Button/useButton.d.ts +8 -0
  37. package/lib/components/Button/useButton.js +50 -0
  38. package/lib/components/Button/useButton.js.map +1 -0
  39. package/lib/components/Button/useButtonStyles.d.ts +3 -0
  40. package/lib/components/Button/useButtonStyles.js +418 -0
  41. package/lib/components/Button/useButtonStyles.js.map +1 -0
  42. package/lib/components/CompoundButton/CompoundButton.d.ts +6 -0
  43. package/lib/components/CompoundButton/CompoundButton.js +15 -0
  44. package/lib/components/CompoundButton/CompoundButton.js.map +1 -0
  45. package/lib/components/CompoundButton/CompoundButton.types.d.ts +14 -0
  46. package/lib/components/CompoundButton/CompoundButton.types.js +2 -0
  47. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -0
  48. package/lib/components/CompoundButton/index.d.ts +5 -0
  49. package/lib/components/CompoundButton/index.js +6 -0
  50. package/lib/components/CompoundButton/index.js.map +1 -0
  51. package/lib/components/CompoundButton/renderCompoundButton.d.ts +5 -0
  52. package/lib/components/CompoundButton/renderCompoundButton.js +23 -0
  53. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -0
  54. package/lib/components/CompoundButton/useCompoundButton.d.ts +8 -0
  55. package/lib/components/CompoundButton/useCompoundButton.js +29 -0
  56. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -0
  57. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +3 -0
  58. package/lib/components/CompoundButton/useCompoundButtonStyles.js +168 -0
  59. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
  60. package/lib/components/MenuButton/MenuButton.d.ts +6 -0
  61. package/lib/components/MenuButton/MenuButton.js +15 -0
  62. package/lib/components/MenuButton/MenuButton.js.map +1 -0
  63. package/lib/components/MenuButton/MenuButton.types.d.ts +10 -0
  64. package/lib/components/MenuButton/MenuButton.types.js +2 -0
  65. package/lib/components/MenuButton/MenuButton.types.js.map +1 -0
  66. package/lib/components/MenuButton/index.d.ts +5 -0
  67. package/lib/components/MenuButton/index.js +6 -0
  68. package/lib/components/MenuButton/index.js.map +1 -0
  69. package/lib/components/MenuButton/renderMenuButton.d.ts +5 -0
  70. package/lib/components/MenuButton/renderMenuButton.js +21 -0
  71. package/lib/components/MenuButton/renderMenuButton.js.map +1 -0
  72. package/lib/components/MenuButton/useMenuButton.d.ts +6 -0
  73. package/lib/components/MenuButton/useMenuButton.js +32 -0
  74. package/lib/components/MenuButton/useMenuButton.js.map +1 -0
  75. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +3 -0
  76. package/lib/components/MenuButton/useMenuButtonStyles.js +36 -0
  77. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -0
  78. package/lib/components/SplitButton/SplitButton.d.ts +7 -0
  79. package/lib/components/SplitButton/SplitButton.js +16 -0
  80. package/lib/components/SplitButton/SplitButton.js.map +1 -0
  81. package/lib/components/SplitButton/SplitButton.types.d.ts +21 -0
  82. package/lib/components/SplitButton/SplitButton.types.js +2 -0
  83. package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
  84. package/lib/components/SplitButton/index.d.ts +5 -0
  85. package/lib/components/SplitButton/index.js +6 -0
  86. package/lib/components/SplitButton/index.js.map +1 -0
  87. package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
  88. package/lib/components/SplitButton/renderSplitButton.js +17 -0
  89. package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
  90. package/lib/components/SplitButton/useSplitButton.d.ts +8 -0
  91. package/lib/components/SplitButton/useSplitButton.js +81 -0
  92. package/lib/components/SplitButton/useSplitButton.js.map +1 -0
  93. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +3 -0
  94. package/lib/components/SplitButton/useSplitButtonStyles.js +93 -0
  95. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  96. package/lib/components/ToggleButton/ToggleButton.d.ts +6 -0
  97. package/lib/components/ToggleButton/ToggleButton.js +15 -0
  98. package/lib/components/ToggleButton/ToggleButton.js.map +1 -0
  99. package/lib/components/ToggleButton/ToggleButton.types.d.ts +20 -0
  100. package/lib/components/ToggleButton/ToggleButton.types.js +2 -0
  101. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -0
  102. package/lib/components/ToggleButton/index.d.ts +5 -0
  103. package/lib/components/ToggleButton/index.js +6 -0
  104. package/lib/components/ToggleButton/index.js.map +1 -0
  105. package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -0
  106. package/lib/components/ToggleButton/renderToggleButton.js +2 -0
  107. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -0
  108. package/lib/components/ToggleButton/useToggleButton.d.ts +9 -0
  109. package/lib/components/ToggleButton/useToggleButton.js +52 -0
  110. package/lib/components/ToggleButton/useToggleButton.js.map +1 -0
  111. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +3 -0
  112. package/lib/components/ToggleButton/useToggleButtonStyles.js +194 -0
  113. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
  114. package/lib/index.d.ts +5 -0
  115. package/lib/index.js +6 -0
  116. package/lib/index.js.map +1 -0
  117. package/lib/tsdoc-metadata.json +11 -0
  118. package/lib-commonjs/Button.d.ts +1 -0
  119. package/lib-commonjs/Button.js +10 -0
  120. package/lib-commonjs/Button.js.map +1 -0
  121. package/lib-commonjs/CompoundButton.d.ts +1 -0
  122. package/lib-commonjs/CompoundButton.js +10 -0
  123. package/lib-commonjs/CompoundButton.js.map +1 -0
  124. package/lib-commonjs/MenuButton.d.ts +1 -0
  125. package/lib-commonjs/MenuButton.js +10 -0
  126. package/lib-commonjs/MenuButton.js.map +1 -0
  127. package/lib-commonjs/SplitButton.d.ts +1 -0
  128. package/lib-commonjs/SplitButton.js +10 -0
  129. package/lib-commonjs/SplitButton.js.map +1 -0
  130. package/lib-commonjs/ToggleButton.d.ts +1 -0
  131. package/lib-commonjs/ToggleButton.js +10 -0
  132. package/lib-commonjs/ToggleButton.js.map +1 -0
  133. package/lib-commonjs/components/Button/Button.d.ts +6 -0
  134. package/lib-commonjs/components/Button/Button.js +26 -0
  135. package/lib-commonjs/components/Button/Button.js.map +1 -0
  136. package/lib-commonjs/components/Button/Button.types.d.ts +62 -0
  137. package/lib-commonjs/components/Button/Button.types.js +6 -0
  138. package/lib-commonjs/components/Button/Button.types.js.map +1 -0
  139. package/lib-commonjs/components/Button/index.d.ts +5 -0
  140. package/lib-commonjs/components/Button/index.js +30 -0
  141. package/lib-commonjs/components/Button/index.js.map +1 -0
  142. package/lib-commonjs/components/Button/renderButton.d.ts +5 -0
  143. package/lib-commonjs/components/Button/renderButton.js +32 -0
  144. package/lib-commonjs/components/Button/renderButton.js.map +1 -0
  145. package/lib-commonjs/components/Button/useButton.d.ts +8 -0
  146. package/lib-commonjs/components/Button/useButton.js +61 -0
  147. package/lib-commonjs/components/Button/useButton.js.map +1 -0
  148. package/lib-commonjs/components/Button/useButtonStyles.d.ts +3 -0
  149. package/lib-commonjs/components/Button/useButtonStyles.js +430 -0
  150. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -0
  151. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +6 -0
  152. package/lib-commonjs/components/CompoundButton/CompoundButton.js +26 -0
  153. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -0
  154. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +14 -0
  155. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +6 -0
  156. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -0
  157. package/lib-commonjs/components/CompoundButton/index.d.ts +5 -0
  158. package/lib-commonjs/components/CompoundButton/index.js +32 -0
  159. package/lib-commonjs/components/CompoundButton/index.js.map +1 -0
  160. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +5 -0
  161. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +34 -0
  162. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -0
  163. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +8 -0
  164. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +40 -0
  165. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -0
  166. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +3 -0
  167. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +180 -0
  168. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
  169. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +6 -0
  170. package/lib-commonjs/components/MenuButton/MenuButton.js +26 -0
  171. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -0
  172. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +10 -0
  173. package/lib-commonjs/components/MenuButton/MenuButton.types.js +6 -0
  174. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -0
  175. package/lib-commonjs/components/MenuButton/index.d.ts +5 -0
  176. package/lib-commonjs/components/MenuButton/index.js +32 -0
  177. package/lib-commonjs/components/MenuButton/index.js.map +1 -0
  178. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +5 -0
  179. package/lib-commonjs/components/MenuButton/renderMenuButton.js +32 -0
  180. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -0
  181. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +6 -0
  182. package/lib-commonjs/components/MenuButton/useMenuButton.js +45 -0
  183. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -0
  184. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +3 -0
  185. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +47 -0
  186. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -0
  187. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
  188. package/lib-commonjs/components/SplitButton/SplitButton.js +27 -0
  189. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
  190. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +21 -0
  191. package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
  192. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
  193. package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
  194. package/lib-commonjs/components/SplitButton/index.js +32 -0
  195. package/lib-commonjs/components/SplitButton/index.js.map +1 -0
  196. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
  197. package/lib-commonjs/components/SplitButton/renderSplitButton.js +28 -0
  198. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
  199. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +8 -0
  200. package/lib-commonjs/components/SplitButton/useSplitButton.js +93 -0
  201. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
  202. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +3 -0
  203. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +105 -0
  204. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  205. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +6 -0
  206. package/lib-commonjs/components/ToggleButton/ToggleButton.js +26 -0
  207. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -0
  208. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +20 -0
  209. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +6 -0
  210. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -0
  211. package/lib-commonjs/components/ToggleButton/index.d.ts +5 -0
  212. package/lib-commonjs/components/ToggleButton/index.js +32 -0
  213. package/lib-commonjs/components/ToggleButton/index.js.map +1 -0
  214. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -0
  215. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +16 -0
  216. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -0
  217. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +9 -0
  218. package/lib-commonjs/components/ToggleButton/useToggleButton.js +64 -0
  219. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -0
  220. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +3 -0
  221. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +206 -0
  222. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
  223. package/lib-commonjs/index.d.ts +5 -0
  224. package/lib-commonjs/index.js +18 -0
  225. package/lib-commonjs/index.js.map +1 -0
  226. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ToggleButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/ToggleButton/index';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ import type { ButtonProps } from './Button.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
+ /**
4
+ * Buttons give people a way to trigger an action.
5
+ */
6
+ export declare const Button: ForwardRefComponent<ButtonProps>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Button = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const renderButton_1 = /*#__PURE__*/require("./renderButton");
11
+
12
+ const useButton_1 = /*#__PURE__*/require("./useButton");
13
+
14
+ const useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
15
+ /**
16
+ * Buttons give people a way to trigger an action.
17
+ */
18
+
19
+
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
+ });
25
+ exports.Button.displayName = 'Button';
26
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
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/"}
@@ -0,0 +1,62 @@
1
+ import type { ARIAButtonSlotProps } from '@fluentui/react-aria';
2
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
+ export declare type ButtonSlots = {
4
+ /**
5
+ * Root of the component that renders as either a `<button>` tag or an `<a>` tag.
6
+ */
7
+ root: Slot<ARIAButtonSlotProps>;
8
+ /**
9
+ * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.
10
+ */
11
+ icon?: Slot<'span'>;
12
+ };
13
+ export declare type ButtonCommons = {
14
+ /**
15
+ * A button can have its content and borders styled for greater emphasis or to be subtle.
16
+ * - 'primary': Emphasizes the button as a primary action.
17
+ * - 'outline': Removes background styling.
18
+ * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
19
+ * - 'transparent': Removes background and border styling.
20
+ */
21
+ appearance?: 'primary' | 'outline' | 'subtle' | 'transparent';
22
+ /**
23
+ * A button can fill the width of its container.
24
+ * @default false
25
+ */
26
+ block: boolean;
27
+ /**
28
+ * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
29
+ * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
30
+ * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
31
+ * @default false
32
+ */
33
+ disabledFocusable: boolean;
34
+ /**
35
+ * A button can show that it cannot be interacted with.
36
+ * @default false
37
+ */
38
+ disabled: boolean;
39
+ /**
40
+ * A button can format its icon to appear before or after its content.
41
+ * @default 'before'
42
+ */
43
+ iconPosition?: 'before' | 'after';
44
+ /**
45
+ * A button can be rounded, circular, or square.
46
+ * @default 'rounded'
47
+ */
48
+ shape: 'rounded' | 'circular' | 'square';
49
+ /**
50
+ * A button supports different sizes.
51
+ * @default 'medium'
52
+ */
53
+ size: 'small' | 'medium' | 'large';
54
+ };
55
+ export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
56
+ export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
57
+ /**
58
+ * A button can contain only an icon.
59
+ * @default false
60
+ */
61
+ iconOnly: boolean;
62
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=Button.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ export * from './Button';
2
+ export type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';
3
+ export * from './renderButton';
4
+ export * from './useButton';
5
+ export { buttonClassName, useButtonStyles_unstable } from './useButtonStyles';
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useButtonStyles_unstable = exports.buttonClassName = void 0;
7
+
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ tslib_1.__exportStar(require("./Button"), exports);
11
+
12
+ tslib_1.__exportStar(require("./renderButton"), exports);
13
+
14
+ tslib_1.__exportStar(require("./useButton"), exports);
15
+
16
+ var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
17
+
18
+ Object.defineProperty(exports, "buttonClassName", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return useButtonStyles_1.buttonClassName;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "useButtonStyles_unstable", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return useButtonStyles_1.useButtonStyles_unstable;
28
+ }
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,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 { buttonClassName, useButtonStyles_unstable } from './useButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ import type { ButtonState } from './Button.types';
2
+ /**
3
+ * Renders a Button component by passing the state defined props to the appropriate slots.
4
+ */
5
+ export declare const renderButton_unstable: (state: ButtonState) => JSX.Element;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderButton_unstable = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+ /**
12
+ * Renders a Button component by passing the state defined props to the appropriate slots.
13
+ */
14
+
15
+
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
+ }));
29
+ };
30
+
31
+ exports.renderButton_unstable = renderButton_unstable;
32
+ //# sourceMappingURL=renderButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Button/renderButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAAuB;AAC1D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAsB,KAAtB,CAA7B;AACA,QAAM;AAAE,IAAA,QAAF;AAAY,IAAA;AAAZ,MAA6B,KAAnC;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,IAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,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/"}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { ButtonProps, ButtonState } from './Button.types';
3
+ /**
4
+ * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
5
+ * @param props - User provided props to the Button component.
6
+ * @param ref - User provided ref to be passed to the Button component.
7
+ */
8
+ export declare const useButton_unstable: (props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ButtonState;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useButton_unstable = void 0;
7
+
8
+ const react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+ /**
12
+ * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
13
+ * @param props - User provided props to the Button component.
14
+ * @param ref - User provided ref to be passed to the Button component.
15
+ */
16
+
17
+
18
+ const useButton_unstable = (props, ref) => {
19
+ const {
20
+ appearance,
21
+ as,
22
+ block = false,
23
+ disabled = false,
24
+ disabledFocusable = false,
25
+ icon,
26
+ iconPosition = 'before',
27
+ shape = 'rounded',
28
+ size = 'medium'
29
+ } = props;
30
+ const iconShorthand = react_utilities_1.resolveShorthand(icon);
31
+ return {
32
+ // Props passed at the top-level
33
+ appearance,
34
+ block,
35
+ disabled,
36
+ disabledFocusable,
37
+ iconPosition,
38
+ shape,
39
+ size,
40
+ // State calculated from a set of props
41
+ iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
42
+ // Slots definition
43
+ components: {
44
+ root: 'button',
45
+ icon: 'span'
46
+ },
47
+ root: react_utilities_1.getNativeElementProps(as || 'button', react_aria_1.useARIAButton(props, {
48
+ required: true,
49
+ defaultProps: {
50
+ // useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>
51
+ ref: ref,
52
+ type: 'button' // This is added because the default for type is 'submit'
53
+
54
+ }
55
+ })),
56
+ icon: iconShorthand
57
+ };
58
+ };
59
+
60
+ exports.useButton_unstable = useButton_unstable;
61
+ //# sourceMappingURL=useButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Button/useButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,kBAAkB,GAAG,CAChC,KADgC,EAEhC,GAFgC,KAGjB;AACf,QAAM;AACJ,IAAA,UADI;AAEJ,IAAA,EAFI;AAGJ,IAAA,KAAK,GAAG,KAHJ;AAIJ,IAAA,QAAQ,GAAG,KAJP;AAKJ,IAAA,iBAAiB,GAAG,KALhB;AAMJ,IAAA,IANI;AAOJ,IAAA,YAAY,GAAG,QAPX;AAQJ,IAAA,KAAK,GAAG,SARJ;AASJ,IAAA,IAAI,GAAG;AATH,MAUF,KAVJ;AAWA,QAAM,aAAa,GAAG,iBAAA,CAAA,gBAAA,CAAiB,IAAjB,CAAtB;AAEA,SAAO;AACL;AACA,IAAA,UAFK;AAGL,IAAA,KAHK;AAIL,IAAA,QAJK;AAKL,IAAA,iBALK;AAML,IAAA,YANK;AAOL,IAAA,KAPK;AAQL,IAAA,IARK;AAUL;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,CAXZ;AAaL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE;AAFI,KAdP;AAmBL,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,CAnBD;AA8BL,IAAA,IAAI,EAAE;AA9BD,GAAP;AAgCD,CAjDM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import * as React from 'react';\nimport { useARIAButton } from '@fluentui/react-aria';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\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,\n as,\n block = false,\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 block,\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/"}
@@ -0,0 +1,3 @@
1
+ import type { ButtonState } from './Button.types';
2
+ export declare const buttonClassName = "fui-Button";
3
+ export declare const useButtonStyles_unstable: (state: ButtonState) => ButtonState;