@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.
- package/CHANGELOG.json +145 -6
- package/CHANGELOG.md +221 -181
- package/dist/{react-button.d.ts → index.d.ts} +3 -1
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Button/useButtonStyles.js +98 -56
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +18 -9
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +12 -7
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +3 -41
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +69 -59
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/useToggleState.js +37 -0
- package/lib/utils/useToggleState.js.map +1 -0
- package/lib-commonjs/components/Button/useButtonStyles.js +99 -56
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +18 -9
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +12 -7
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +3 -42
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +73 -61
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +10 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +10 -0
- package/lib-commonjs/utils/index.js.map +1 -0
- package/lib-commonjs/utils/useToggleState.js +48 -0
- package/lib-commonjs/utils/useToggleState.js.map +1 -0
- package/package.json +10 -10
- package/lib/Button.d.ts +0 -1
- package/lib/CompoundButton.d.ts +0 -1
- package/lib/MenuButton.d.ts +0 -1
- package/lib/SplitButton.d.ts +0 -1
- package/lib/ToggleButton.d.ts +0 -1
- package/lib/components/Button/Button.d.ts +0 -6
- package/lib/components/Button/Button.types.d.ts +0 -64
- package/lib/components/Button/index.d.ts +0 -5
- package/lib/components/Button/renderButton.d.ts +0 -5
- package/lib/components/Button/useButton.d.ts +0 -8
- package/lib/components/Button/useButtonStyles.d.ts +0 -8
- package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
- package/lib/components/CompoundButton/index.d.ts +0 -5
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
- package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -8
- package/lib/components/MenuButton/MenuButton.d.ts +0 -6
- package/lib/components/MenuButton/MenuButton.types.d.ts +0 -10
- package/lib/components/MenuButton/index.d.ts +0 -5
- package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
- package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -8
- package/lib/components/SplitButton/SplitButton.d.ts +0 -7
- package/lib/components/SplitButton/SplitButton.types.d.ts +0 -21
- package/lib/components/SplitButton/index.d.ts +0 -5
- package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
- package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -8
- package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -20
- package/lib/components/ToggleButton/index.d.ts +0 -5
- package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
- package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -9
- package/lib/index.d.ts +0 -10
- package/lib-commonjs/Button.d.ts +0 -1
- package/lib-commonjs/CompoundButton.d.ts +0 -1
- package/lib-commonjs/MenuButton.d.ts +0 -1
- package/lib-commonjs/SplitButton.d.ts +0 -1
- package/lib-commonjs/ToggleButton.d.ts +0 -1
- package/lib-commonjs/components/Button/Button.d.ts +0 -6
- package/lib-commonjs/components/Button/Button.types.d.ts +0 -64
- package/lib-commonjs/components/Button/index.d.ts +0 -5
- package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
- package/lib-commonjs/components/Button/useButton.d.ts +0 -8
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -8
- package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
- package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -8
- package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -10
- package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -8
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -21
- package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -8
- package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -20
- package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -9
- package/lib-commonjs/index.d.ts +0 -10
@@ -1,64 +0,0 @@
|
|
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: NonNullable<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
|
-
* @deprecated - Use style overrides instead.
|
27
|
-
*/
|
28
|
-
block: boolean;
|
29
|
-
/**
|
30
|
-
* When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
|
31
|
-
* is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
|
32
|
-
* pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
|
33
|
-
* @default false
|
34
|
-
*/
|
35
|
-
disabledFocusable: boolean;
|
36
|
-
/**
|
37
|
-
* A button can show that it cannot be interacted with.
|
38
|
-
* @default false
|
39
|
-
*/
|
40
|
-
disabled: boolean;
|
41
|
-
/**
|
42
|
-
* A button can format its icon to appear before or after its content.
|
43
|
-
* @default 'before'
|
44
|
-
*/
|
45
|
-
iconPosition?: 'before' | 'after';
|
46
|
-
/**
|
47
|
-
* A button can be rounded, circular, or square.
|
48
|
-
* @default 'rounded'
|
49
|
-
*/
|
50
|
-
shape: 'rounded' | 'circular' | 'square';
|
51
|
-
/**
|
52
|
-
* A button supports different sizes.
|
53
|
-
* @default 'medium'
|
54
|
-
*/
|
55
|
-
size: 'small' | 'medium' | 'large';
|
56
|
-
};
|
57
|
-
export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
|
58
|
-
export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
|
59
|
-
/**
|
60
|
-
* A button can contain only an icon.
|
61
|
-
* @default false
|
62
|
-
*/
|
63
|
-
iconOnly: boolean;
|
64
|
-
};
|
@@ -1,8 +0,0 @@
|
|
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;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonSlots, ButtonState } from './Button.types';
|
3
|
-
export declare const buttonClassNames: SlotClassNames<ButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `buttonClassNames.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const buttonClassName: string;
|
8
|
-
export declare const useButtonStyles_unstable: (state: ButtonState) => ButtonState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { CompoundButtonProps } from './CompoundButton.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
5
|
-
*/
|
6
|
-
export declare const CompoundButton: ForwardRefComponent<CompoundButtonProps>;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
|
-
export declare type CompoundButtonSlots = ButtonSlots & {
|
4
|
-
/**
|
5
|
-
* Second line of text that describes the action this button takes.
|
6
|
-
*/
|
7
|
-
secondaryContent?: Slot<'span'>;
|
8
|
-
/**
|
9
|
-
* Container that wraps the children and the secondaryContent slot.
|
10
|
-
*/
|
11
|
-
contentContainer: NonNullable<Slot<'span'>>;
|
12
|
-
};
|
13
|
-
export declare type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> & Partial<ButtonCommons>;
|
14
|
-
export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export * from './CompoundButton';
|
2
|
-
export * from './CompoundButton.types';
|
3
|
-
export * from './renderCompoundButton';
|
4
|
-
export * from './useCompoundButton';
|
5
|
-
export { compoundButtonClassName, compoundButtonClassNames, useCompoundButtonStyles_unstable, } from './useCompoundButtonStyles';
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { CompoundButtonState } from './CompoundButton.types';
|
2
|
-
/**
|
3
|
-
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
4
|
-
*/
|
5
|
-
export declare const renderCompoundButton_unstable: (state: CompoundButtonState) => JSX.Element;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';
|
3
|
-
/**
|
4
|
-
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
5
|
-
* @param props - User provided props to the CompoundButton component.
|
6
|
-
* @param ref - User provided ref to be passed to the CompoundButton component.
|
7
|
-
*/
|
8
|
-
export declare const useCompoundButton_unstable: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';
|
3
|
-
export declare const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `compoundButtonClassName.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const compoundButtonClassName: string;
|
8
|
-
export declare const useCompoundButtonStyles_unstable: (state: CompoundButtonState) => CompoundButtonState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuButtonProps } from './MenuButton.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* MenuButtons are buttons that handle opening and closing a menu when they are triggered.
|
5
|
-
*/
|
6
|
-
export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
|
-
export declare type MenuButtonSlots = ButtonSlots & {
|
4
|
-
/**
|
5
|
-
* Menu icon that indicates that this button has a menu that can be expanded.
|
6
|
-
*/
|
7
|
-
menuIcon?: Slot<'span'>;
|
8
|
-
};
|
9
|
-
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>>;
|
10
|
-
export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
|
@@ -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_unstable: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';
|
3
|
-
export declare const menuButtonClassNames: SlotClassNames<MenuButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `menuButtonClassName.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const menuButtonClassName: string;
|
8
|
-
export declare const useMenuButtonStyles_unstable: (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,21 +0,0 @@
|
|
1
|
-
import { Button } from '../Button/Button';
|
2
|
-
import { MenuButton } from '../MenuButton/MenuButton';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
import type { ButtonProps, ButtonState } from '../Button/Button.types';
|
5
|
-
import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';
|
6
|
-
export declare type SplitButtonSlots = {
|
7
|
-
/**
|
8
|
-
* Root of the component that wraps the primary action button and menu button.
|
9
|
-
*/
|
10
|
-
root: NonNullable<Slot<'div'>>;
|
11
|
-
/**
|
12
|
-
* Button that opens menu with secondary actions in SplitButton.
|
13
|
-
*/
|
14
|
-
menuButton?: Slot<typeof MenuButton>;
|
15
|
-
/**
|
16
|
-
* Button to perform primary action in SplitButton.
|
17
|
-
*/
|
18
|
-
primaryActionButton?: Slot<typeof Button>;
|
19
|
-
};
|
20
|
-
export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
|
21
|
-
export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
|
@@ -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;
|
package/lib/index.d.ts
DELETED
@@ -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';
|
package/lib-commonjs/Button.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Button/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/CompoundButton/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/MenuButton/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/SplitButton/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/ToggleButton/index';
|
@@ -1,64 +0,0 @@
|
|
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: NonNullable<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
|
-
* @deprecated - Use style overrides instead.
|
27
|
-
*/
|
28
|
-
block: boolean;
|
29
|
-
/**
|
30
|
-
* When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
|
31
|
-
* is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
|
32
|
-
* pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
|
33
|
-
* @default false
|
34
|
-
*/
|
35
|
-
disabledFocusable: boolean;
|
36
|
-
/**
|
37
|
-
* A button can show that it cannot be interacted with.
|
38
|
-
* @default false
|
39
|
-
*/
|
40
|
-
disabled: boolean;
|
41
|
-
/**
|
42
|
-
* A button can format its icon to appear before or after its content.
|
43
|
-
* @default 'before'
|
44
|
-
*/
|
45
|
-
iconPosition?: 'before' | 'after';
|
46
|
-
/**
|
47
|
-
* A button can be rounded, circular, or square.
|
48
|
-
* @default 'rounded'
|
49
|
-
*/
|
50
|
-
shape: 'rounded' | 'circular' | 'square';
|
51
|
-
/**
|
52
|
-
* A button supports different sizes.
|
53
|
-
* @default 'medium'
|
54
|
-
*/
|
55
|
-
size: 'small' | 'medium' | 'large';
|
56
|
-
};
|
57
|
-
export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
|
58
|
-
export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
|
59
|
-
/**
|
60
|
-
* A button can contain only an icon.
|
61
|
-
* @default false
|
62
|
-
*/
|
63
|
-
iconOnly: boolean;
|
64
|
-
};
|
@@ -1,8 +0,0 @@
|
|
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;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonSlots, ButtonState } from './Button.types';
|
3
|
-
export declare const buttonClassNames: SlotClassNames<ButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `buttonClassNames.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const buttonClassName: string;
|
8
|
-
export declare const useButtonStyles_unstable: (state: ButtonState) => ButtonState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { CompoundButtonProps } from './CompoundButton.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
5
|
-
*/
|
6
|
-
export declare const CompoundButton: ForwardRefComponent<CompoundButtonProps>;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
|
-
export declare type CompoundButtonSlots = ButtonSlots & {
|
4
|
-
/**
|
5
|
-
* Second line of text that describes the action this button takes.
|
6
|
-
*/
|
7
|
-
secondaryContent?: Slot<'span'>;
|
8
|
-
/**
|
9
|
-
* Container that wraps the children and the secondaryContent slot.
|
10
|
-
*/
|
11
|
-
contentContainer: NonNullable<Slot<'span'>>;
|
12
|
-
};
|
13
|
-
export declare type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> & Partial<ButtonCommons>;
|
14
|
-
export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export * from './CompoundButton';
|
2
|
-
export * from './CompoundButton.types';
|
3
|
-
export * from './renderCompoundButton';
|
4
|
-
export * from './useCompoundButton';
|
5
|
-
export { compoundButtonClassName, compoundButtonClassNames, useCompoundButtonStyles_unstable, } from './useCompoundButtonStyles';
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import type { CompoundButtonState } from './CompoundButton.types';
|
2
|
-
/**
|
3
|
-
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
4
|
-
*/
|
5
|
-
export declare const renderCompoundButton_unstable: (state: CompoundButtonState) => JSX.Element;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';
|
3
|
-
/**
|
4
|
-
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
5
|
-
* @param props - User provided props to the CompoundButton component.
|
6
|
-
* @param ref - User provided ref to be passed to the CompoundButton component.
|
7
|
-
*/
|
8
|
-
export declare const useCompoundButton_unstable: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';
|
3
|
-
export declare const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `compoundButtonClassName.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const compoundButtonClassName: string;
|
8
|
-
export declare const useCompoundButtonStyles_unstable: (state: CompoundButtonState) => CompoundButtonState;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { MenuButtonProps } from './MenuButton.types';
|
2
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* MenuButtons are buttons that handle opening and closing a menu when they are triggered.
|
5
|
-
*/
|
6
|
-
export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
-
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
|
-
export declare type MenuButtonSlots = ButtonSlots & {
|
4
|
-
/**
|
5
|
-
* Menu icon that indicates that this button has a menu that can be expanded.
|
6
|
-
*/
|
7
|
-
menuIcon?: Slot<'span'>;
|
8
|
-
};
|
9
|
-
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>>;
|
10
|
-
export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
|
@@ -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_unstable: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
2
|
-
import type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';
|
3
|
-
export declare const menuButtonClassNames: SlotClassNames<MenuButtonSlots>;
|
4
|
-
/**
|
5
|
-
* @deprecated Use `menuButtonClassName.root` instead.
|
6
|
-
*/
|
7
|
-
export declare const menuButtonClassName: string;
|
8
|
-
export declare const useMenuButtonStyles_unstable: (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,21 +0,0 @@
|
|
1
|
-
import { Button } from '../Button/Button';
|
2
|
-
import { MenuButton } from '../MenuButton/MenuButton';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
import type { ButtonProps, ButtonState } from '../Button/Button.types';
|
5
|
-
import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';
|
6
|
-
export declare type SplitButtonSlots = {
|
7
|
-
/**
|
8
|
-
* Root of the component that wraps the primary action button and menu button.
|
9
|
-
*/
|
10
|
-
root: NonNullable<Slot<'div'>>;
|
11
|
-
/**
|
12
|
-
* Button that opens menu with secondary actions in SplitButton.
|
13
|
-
*/
|
14
|
-
menuButton?: Slot<typeof MenuButton>;
|
15
|
-
/**
|
16
|
-
* Button to perform primary action in SplitButton.
|
17
|
-
*/
|
18
|
-
primaryActionButton?: Slot<typeof Button>;
|
19
|
-
};
|
20
|
-
export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
|
21
|
-
export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
|