@fluentui/react-button 9.0.0-rc.6 → 9.0.0-rc.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/CHANGELOG.json +145 -6
  2. package/CHANGELOG.md +221 -181
  3. package/dist/{react-button.d.ts → index.d.ts} +3 -1
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/components/Button/useButtonStyles.js +98 -56
  6. package/lib/components/Button/useButtonStyles.js.map +1 -1
  7. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  8. package/lib/components/CompoundButton/useCompoundButtonStyles.js +18 -9
  9. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  10. package/lib/components/SplitButton/useSplitButtonStyles.js +12 -7
  11. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  12. package/lib/components/ToggleButton/useToggleButton.js +3 -41
  13. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  14. package/lib/components/ToggleButton/useToggleButtonStyles.js +69 -59
  15. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  16. package/lib/index.js +1 -0
  17. package/lib/index.js.map +1 -1
  18. package/lib/utils/index.js +2 -0
  19. package/lib/utils/index.js.map +1 -0
  20. package/lib/utils/useToggleState.js +37 -0
  21. package/lib/utils/useToggleState.js.map +1 -0
  22. package/lib-commonjs/components/Button/useButtonStyles.js +99 -56
  23. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  24. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  25. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +18 -9
  26. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  27. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +12 -7
  28. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  29. package/lib-commonjs/components/ToggleButton/useToggleButton.js +3 -42
  30. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  31. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +73 -61
  32. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  33. package/lib-commonjs/index.js +10 -1
  34. package/lib-commonjs/index.js.map +1 -1
  35. package/lib-commonjs/utils/index.js +10 -0
  36. package/lib-commonjs/utils/index.js.map +1 -0
  37. package/lib-commonjs/utils/useToggleState.js +48 -0
  38. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  39. package/package.json +10 -10
  40. package/lib/Button.d.ts +0 -1
  41. package/lib/CompoundButton.d.ts +0 -1
  42. package/lib/MenuButton.d.ts +0 -1
  43. package/lib/SplitButton.d.ts +0 -1
  44. package/lib/ToggleButton.d.ts +0 -1
  45. package/lib/components/Button/Button.d.ts +0 -6
  46. package/lib/components/Button/Button.types.d.ts +0 -64
  47. package/lib/components/Button/index.d.ts +0 -5
  48. package/lib/components/Button/renderButton.d.ts +0 -5
  49. package/lib/components/Button/useButton.d.ts +0 -8
  50. package/lib/components/Button/useButtonStyles.d.ts +0 -8
  51. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  52. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  53. package/lib/components/CompoundButton/index.d.ts +0 -5
  54. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  55. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  56. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -8
  57. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  58. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -10
  59. package/lib/components/MenuButton/index.d.ts +0 -5
  60. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  61. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  62. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -8
  63. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  64. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -21
  65. package/lib/components/SplitButton/index.d.ts +0 -5
  66. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  67. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  68. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -8
  69. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  70. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -20
  71. package/lib/components/ToggleButton/index.d.ts +0 -5
  72. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  73. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  74. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -9
  75. package/lib/index.d.ts +0 -10
  76. package/lib-commonjs/Button.d.ts +0 -1
  77. package/lib-commonjs/CompoundButton.d.ts +0 -1
  78. package/lib-commonjs/MenuButton.d.ts +0 -1
  79. package/lib-commonjs/SplitButton.d.ts +0 -1
  80. package/lib-commonjs/ToggleButton.d.ts +0 -1
  81. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  82. package/lib-commonjs/components/Button/Button.types.d.ts +0 -64
  83. package/lib-commonjs/components/Button/index.d.ts +0 -5
  84. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  85. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  86. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -8
  87. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  88. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  89. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  90. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  91. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  92. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -8
  93. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  94. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -10
  95. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  96. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  97. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  98. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -8
  99. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  100. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -21
  101. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  102. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  103. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  104. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -8
  105. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  106. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -20
  107. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  108. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  109. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  110. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -9
  111. package/lib-commonjs/index.d.ts +0 -10
@@ -1,5 +0,0 @@
1
- export * from './SplitButton';
2
- export * from './SplitButton.types';
3
- export * from './renderSplitButton';
4
- export * from './useSplitButton';
5
- export { splitButtonClassName, splitButtonClassNames, useSplitButtonStyles_unstable, } 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_unstable: (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_unstable: (props: SplitButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
@@ -1,8 +0,0 @@
1
- import type { SlotClassNames } from '@fluentui/react-utilities';
2
- import type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';
3
- export declare const splitButtonClassNames: SlotClassNames<SplitButtonSlots>;
4
- /**
5
- * @deprecated Use `splitButtonClassName.root` instead.
6
- */
7
- export declare const splitButtonClassName: string;
8
- export declare const useSplitButtonStyles_unstable: (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,20 +0,0 @@
1
- import type { ButtonProps, ButtonState } from '../Button/Button.types';
2
- 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;
20
- export {};
@@ -1,5 +0,0 @@
1
- export * from './ToggleButton';
2
- export * from './ToggleButton.types';
3
- export * from './renderToggleButton';
4
- export * from './useToggleButton';
5
- export { toggleButtonClassName, toggleButtonClassNames, useToggleButtonStyles_unstable, } from './useToggleButtonStyles';
@@ -1 +0,0 @@
1
- export { renderButton_unstable as renderToggleButton_unstable } 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_unstable: ({ checked, defaultChecked, ...props }: ToggleButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToggleButtonState;
@@ -1,9 +0,0 @@
1
- import type { SlotClassNames } from '@fluentui/react-utilities';
2
- import type { ButtonSlots } from '../Button/Button.types';
3
- import type { ToggleButtonState } from './ToggleButton.types';
4
- export declare const toggleButtonClassNames: SlotClassNames<ButtonSlots>;
5
- /**
6
- * @deprecated Use `toggleButtonClassName.root` instead.
7
- */
8
- export declare const toggleButtonClassName: string;
9
- export declare const useToggleButtonStyles_unstable: (state: ToggleButtonState) => ToggleButtonState;
@@ -1,10 +0,0 @@
1
- export { Button, buttonClassName, buttonClassNames, renderButton_unstable, useButtonStyles_unstable, useButton_unstable, } from './Button';
2
- export type { ButtonProps, ButtonSlots, ButtonState } from './Button';
3
- export { CompoundButton, compoundButtonClassName, compoundButtonClassNames, renderCompoundButton_unstable, useCompoundButtonStyles_unstable, useCompoundButton_unstable, } from './CompoundButton';
4
- export type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';
5
- export { MenuButton, menuButtonClassName, menuButtonClassNames, renderMenuButton_unstable, useMenuButtonStyles_unstable, useMenuButton_unstable, } from './MenuButton';
6
- export type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuButton';
7
- export { SplitButton, renderSplitButton_unstable, splitButtonClassName, splitButtonClassNames, useSplitButtonStyles_unstable, useSplitButton_unstable, } from './SplitButton';
8
- export type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';
9
- export { ToggleButton, renderToggleButton_unstable, toggleButtonClassName, toggleButtonClassNames, useToggleButtonStyles_unstable, useToggleButton_unstable, } from './ToggleButton';
10
- export type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';