@fluentui/react-button 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. package/CHANGELOG.json +864 -27
  2. package/CHANGELOG.md +375 -181
  3. package/dist/{react-button.d.ts → index.d.ts} +97 -53
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Button.js.map +1 -1
  6. package/lib/CompoundButton.js.map +1 -1
  7. package/lib/MenuButton.js.map +1 -1
  8. package/lib/SplitButton.js.map +1 -1
  9. package/lib/ToggleButton.js.map +1 -1
  10. package/lib/components/Button/Button.js +7 -7
  11. package/lib/components/Button/Button.js.map +1 -1
  12. package/lib/components/Button/Button.types.js.map +1 -1
  13. package/lib/components/Button/index.js +3 -2
  14. package/lib/components/Button/index.js.map +1 -1
  15. package/lib/components/Button/renderButton.js +13 -9
  16. package/lib/components/Button/renderButton.js.map +1 -1
  17. package/lib/components/Button/useButton.js +23 -25
  18. package/lib/components/Button/useButton.js.map +1 -1
  19. package/lib/components/Button/useButtonStyles.js +248 -162
  20. package/lib/components/Button/useButtonStyles.js.map +1 -1
  21. package/lib/components/CompoundButton/CompoundButton.js +7 -7
  22. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  23. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  24. package/lib/components/CompoundButton/index.js +3 -1
  25. package/lib/components/CompoundButton/index.js.map +1 -1
  26. package/lib/components/CompoundButton/renderCompoundButton.js +15 -9
  27. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  28. package/lib/components/CompoundButton/useCompoundButton.js +13 -8
  29. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  30. package/lib/components/CompoundButton/useCompoundButtonStyles.js +101 -75
  31. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  32. package/lib/components/MenuButton/MenuButton.js +7 -7
  33. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  34. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  35. package/lib/components/MenuButton/index.js +3 -1
  36. package/lib/components/MenuButton/index.js.map +1 -1
  37. package/lib/components/MenuButton/renderMenuButton.js +13 -9
  38. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  39. package/lib/components/MenuButton/useMenuButton.js +11 -11
  40. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  41. package/lib/components/MenuButton/useMenuButtonStyles.js +44 -17
  42. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  43. package/lib/components/SplitButton/SplitButton.js +7 -7
  44. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  45. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  46. package/lib/components/SplitButton/index.js +3 -1
  47. package/lib/components/SplitButton/index.js.map +1 -1
  48. package/lib/components/SplitButton/renderSplitButton.js +9 -7
  49. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  50. package/lib/components/SplitButton/useSplitButton.js +58 -49
  51. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  52. package/lib/components/SplitButton/useSplitButtonStyles.js +53 -36
  53. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  54. package/lib/components/ToggleButton/ToggleButton.js +7 -7
  55. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  56. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  57. package/lib/components/ToggleButton/index.js +3 -1
  58. package/lib/components/ToggleButton/index.js.map +1 -1
  59. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  60. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  61. package/lib/components/ToggleButton/useToggleButton.js +5 -41
  62. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  63. package/lib/components/ToggleButton/useToggleButtonStyles.js +114 -85
  64. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  65. package/lib/index.js +11 -5
  66. package/lib/index.js.map +1 -1
  67. package/lib/utils/index.js +2 -0
  68. package/lib/utils/index.js.map +1 -0
  69. package/lib/utils/useToggleState.js +37 -0
  70. package/lib/utils/useToggleState.js.map +1 -0
  71. package/lib-commonjs/Button.js +1 -1
  72. package/lib-commonjs/Button.js.map +1 -1
  73. package/lib-commonjs/CompoundButton.js +1 -1
  74. package/lib-commonjs/CompoundButton.js.map +1 -1
  75. package/lib-commonjs/MenuButton.js +1 -1
  76. package/lib-commonjs/MenuButton.js.map +1 -1
  77. package/lib-commonjs/SplitButton.js +1 -1
  78. package/lib-commonjs/SplitButton.js.map +1 -1
  79. package/lib-commonjs/ToggleButton.js +1 -1
  80. package/lib-commonjs/ToggleButton.js.map +1 -1
  81. package/lib-commonjs/components/Button/Button.js +8 -8
  82. package/lib-commonjs/components/Button/Button.js.map +1 -1
  83. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  84. package/lib-commonjs/components/Button/index.js +18 -6
  85. package/lib-commonjs/components/Button/index.js.map +1 -1
  86. package/lib-commonjs/components/Button/renderButton.js +17 -14
  87. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  88. package/lib-commonjs/components/Button/useButton.js +27 -29
  89. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  90. package/lib-commonjs/components/Button/useButtonStyles.js +251 -163
  91. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  92. package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
  93. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  94. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  95. package/lib-commonjs/components/CompoundButton/index.js +18 -4
  96. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  97. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +19 -14
  98. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  99. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +16 -12
  100. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  101. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +104 -77
  102. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  103. package/lib-commonjs/components/MenuButton/MenuButton.js +8 -8
  104. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  105. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  106. package/lib-commonjs/components/MenuButton/index.js +18 -4
  107. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  108. package/lib-commonjs/components/MenuButton/renderMenuButton.js +17 -14
  109. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  110. package/lib-commonjs/components/MenuButton/useMenuButton.js +15 -16
  111. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  112. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +48 -19
  113. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  114. package/lib-commonjs/components/SplitButton/SplitButton.js +8 -8
  115. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  116. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  117. package/lib-commonjs/components/SplitButton/index.js +18 -4
  118. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  119. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -12
  120. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  121. package/lib-commonjs/components/SplitButton/useSplitButton.js +62 -54
  122. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  123. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +57 -39
  124. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  125. package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
  126. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  127. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  128. package/lib-commonjs/components/ToggleButton/index.js +18 -4
  129. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  130. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
  131. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  132. package/lib-commonjs/components/ToggleButton/useToggleButton.js +7 -45
  133. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  134. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +119 -86
  135. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  136. package/lib-commonjs/index.js +204 -6
  137. package/lib-commonjs/index.js.map +1 -1
  138. package/lib-commonjs/utils/index.js +10 -0
  139. package/lib-commonjs/utils/index.js.map +1 -0
  140. package/lib-commonjs/utils/useToggleState.js +48 -0
  141. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  142. package/package.json +22 -27
  143. package/dist/demo/index.html +0 -71
  144. package/dist/demo/react-dom.development.js +0 -21413
  145. package/dist/demo/react.development.js +0 -3155
  146. package/lib/Button.d.ts +0 -1
  147. package/lib/CompoundButton.d.ts +0 -1
  148. package/lib/MenuButton.d.ts +0 -1
  149. package/lib/SplitButton.d.ts +0 -1
  150. package/lib/ToggleButton.d.ts +0 -1
  151. package/lib/common/isConformant.d.ts +0 -4
  152. package/lib/common/isConformant.js +0 -13
  153. package/lib/common/isConformant.js.map +0 -1
  154. package/lib/components/Button/Button.d.ts +0 -6
  155. package/lib/components/Button/Button.types.d.ts +0 -62
  156. package/lib/components/Button/index.d.ts +0 -5
  157. package/lib/components/Button/renderButton.d.ts +0 -5
  158. package/lib/components/Button/useButton.d.ts +0 -8
  159. package/lib/components/Button/useButtonStyles.d.ts +0 -10
  160. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  161. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  162. package/lib/components/CompoundButton/index.d.ts +0 -5
  163. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  164. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  165. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  166. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  167. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -11
  168. package/lib/components/MenuButton/index.d.ts +0 -5
  169. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  170. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  171. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  172. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  173. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -19
  174. package/lib/components/SplitButton/index.d.ts +0 -5
  175. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  176. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  177. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  178. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  179. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  180. package/lib/components/ToggleButton/index.d.ts +0 -5
  181. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  182. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  183. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  184. package/lib/index.d.ts +0 -5
  185. package/lib-commonjs/Button.d.ts +0 -1
  186. package/lib-commonjs/CompoundButton.d.ts +0 -1
  187. package/lib-commonjs/MenuButton.d.ts +0 -1
  188. package/lib-commonjs/SplitButton.d.ts +0 -1
  189. package/lib-commonjs/ToggleButton.d.ts +0 -1
  190. package/lib-commonjs/common/isConformant.d.ts +0 -4
  191. package/lib-commonjs/common/isConformant.js +0 -24
  192. package/lib-commonjs/common/isConformant.js.map +0 -1
  193. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  194. package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
  195. package/lib-commonjs/components/Button/index.d.ts +0 -5
  196. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  197. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  198. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -10
  199. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  200. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  201. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  202. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  203. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  204. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  205. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  206. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -11
  207. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  208. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  209. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  210. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  211. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  212. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -19
  213. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  214. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  215. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  216. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  217. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  218. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  219. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  220. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  221. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  222. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  223. package/lib-commonjs/index.d.ts +0 -5
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { MenuButtonProps, MenuButtonState } from './MenuButton.types';
3
- /**
4
- * Given user props, returns the final state for a MenuButton.
5
- */
6
- export declare const useMenuButton: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
@@ -1,2 +0,0 @@
1
- import type { MenuButtonState } from './MenuButton.types';
2
- export declare const useMenuButtonStyles: (state: MenuButtonState) => MenuButtonState;
@@ -1,7 +0,0 @@
1
- import type { SplitButtonProps } from './SplitButton.types';
2
- import { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
5
- * action, while interacting with the second one opens a menu with secondary actions.
6
- */
7
- export declare const SplitButton: ForwardRefComponent<SplitButtonProps>;
@@ -1,19 +0,0 @@
1
- import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
2
- import type { ButtonProps, ButtonState } from '../Button/Button.types';
3
- import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';
4
- export declare type SplitButtonSlots = {
5
- /**
6
- * Root of the component that wraps the primary action button and menu button.
7
- */
8
- root: IntrinsicShorthandProps<'div'>;
9
- /**
10
- * Button that opens menu with secondary actions in SplitButton.
11
- */
12
- menuButton?: ObjectShorthandProps<MenuButtonProps>;
13
- /**
14
- * Button to perform primary action in SplitButton.
15
- */
16
- primaryActionButton?: ObjectShorthandProps<ButtonProps>;
17
- };
18
- export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
19
- export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
@@ -1,5 +0,0 @@
1
- export * from './SplitButton';
2
- export * from './SplitButton.types';
3
- export * from './renderSplitButton';
4
- export * from './useSplitButton';
5
- export { useSplitButtonStyles } from './useSplitButtonStyles';
@@ -1,5 +0,0 @@
1
- import type { SplitButtonState } from './SplitButton.types';
2
- /**
3
- * Renders a SplitButton component by passing the state defined props to the appropriate slots.
4
- */
5
- export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import type { SplitButtonProps, SplitButtonState } from './SplitButton.types';
3
- /**
4
- * Given user props, defines default props for the SplitButton and returns processed state.
5
- * @param props - User provided props to the SplitButton component.
6
- * @param ref - User provided ref to be passed to the SplitButton component.
7
- */
8
- export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
@@ -1,2 +0,0 @@
1
- import type { SplitButtonState } from './SplitButton.types';
2
- export declare const useSplitButtonStyles: (state: SplitButtonState) => SplitButtonState;
@@ -1,6 +0,0 @@
1
- import type { ToggleButtonProps } from './ToggleButton.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * ToggleButtons are buttons that toggle between two defined states when triggered.
5
- */
6
- export declare const ToggleButton: ForwardRefComponent<ToggleButtonProps>;
@@ -1,19 +0,0 @@
1
- import type { ButtonProps, ButtonState } from '../Button/Button.types';
2
- export declare type ToggleButtonCommons = {
3
- /**
4
- * Defines the controlled checked state of the `ToggleButton`.
5
- * If passed, `ToggleButton` ignores the `defaultChecked` property.
6
- * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
7
- * correct value based on handling `onClick` events and re-rendering.
8
- * @default false
9
- */
10
- checked: boolean;
11
- };
12
- export declare type ToggleButtonProps = ButtonProps & Partial<ToggleButtonCommons> & {
13
- /**
14
- * Defines whether the `ToggleButton` is initially in a checked state or not when rendered.
15
- * @default false
16
- */
17
- defaultChecked?: boolean;
18
- };
19
- export declare type ToggleButtonState = ButtonState & ToggleButtonCommons;
@@ -1,5 +0,0 @@
1
- export * from './ToggleButton';
2
- export * from './ToggleButton.types';
3
- export * from './renderToggleButton';
4
- export * from './useToggleButton';
5
- export { useToggleButtonStyles } from './useToggleButtonStyles';
@@ -1 +0,0 @@
1
- export { renderButton as renderToggleButton } from '../Button/renderButton';
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';
3
- /**
4
- * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
5
- * processed state.
6
- * @param props - User provided props to the ToggleButton component.
7
- * @param ref - User provided ref to be passed to the ToggleButton component.
8
- */
9
- export declare const useToggleButton: ({ checked, defaultChecked, ...props }: ToggleButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToggleButtonState;
@@ -1,2 +0,0 @@
1
- import type { ToggleButtonState } from './ToggleButton.types';
2
- export declare const useToggleButtonStyles: (state: ToggleButtonState) => ToggleButtonState;
@@ -1,5 +0,0 @@
1
- export * from './Button';
2
- export * from './CompoundButton';
3
- export * from './MenuButton';
4
- export * from './SplitButton';
5
- export * from './ToggleButton';