Skip to content

Commit

Permalink
fix(constants): remove buttonVariantProptype from constants (#1436)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `buttonVariantPropType` has been removed from constants.
This is mostly intended for internal use, but was part of the public API.
  • Loading branch information
Birkbjo authored Dec 6, 2023
1 parent 00334c5 commit d4dc535
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
18 changes: 12 additions & 6 deletions components/button/src/dropdown-button/dropdown-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ DropdownButton.propTypes = {
/** Component to show/hide when button is clicked */
component: PropTypes.element,
dataTest: PropTypes.string,
/** Button variant. Mutually exclusive with `primary` and `secondary` props */
destructive: sharedPropTypes.buttonVariantPropType,
/**
* Applies 'destructive' button appearance, implying a dangerous action.
*/
destructive: PropTypes.bool,
/** Make the button non-interactive */
disabled: PropTypes.bool,
icon: PropTypes.element,
Expand All @@ -187,10 +189,14 @@ DropdownButton.propTypes = {
name: PropTypes.string,
/** Controls popper visibility. When implementing this prop the component becomes a controlled component */
open: PropTypes.bool,
/** Button variant. Mutually exclusive with `destructive` and `secondary` props */
primary: sharedPropTypes.buttonVariantPropType,
/** Button variant. Mutually exclusive with `primary` and `destructive` props */
secondary: sharedPropTypes.buttonVariantPropType,
/**
* Applies 'primary' button appearance, implying the most important action.
*/
primary: PropTypes.bool,
/**
* Applies 'secondary' button appearance.
*/
secondary: PropTypes.bool,
/** Button size. Mutually exclusive with `large` prop */
small: sharedPropTypes.sizePropType,
tabIndex: PropTypes.string,
Expand Down
18 changes: 12 additions & 6 deletions components/button/src/split-button/split-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ SplitButton.propTypes = {
/** Component to render when the dropdown is opened */
component: PropTypes.element,
dataTest: PropTypes.string,
/** Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props */
destructive: sharedPropTypes.buttonVariantPropType,
/**
* Applies 'destructive' button appearance, implying a dangerous action.
*/
destructive: PropTypes.bool,
/** Disables the button and makes it uninteractive */
disabled: PropTypes.bool,
/** An icon to add inside the button */
Expand All @@ -158,10 +160,14 @@ SplitButton.propTypes = {
/** Changes button size. Mutually exclusive with `small` prop */
large: sharedPropTypes.sizePropType,
name: PropTypes.string,
/** Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props */
primary: sharedPropTypes.buttonVariantPropType,
/** Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props */
secondary: sharedPropTypes.buttonVariantPropType,
/**
* Applies 'primary' button appearance, implying the most important action.
*/
primary: PropTypes.bool,
/**
* Applies 'secondary' button appearance.
*/
secondary: PropTypes.bool,
/** Changes button size. Mutually exclusive with `large` prop */
small: sharedPropTypes.sizePropType,
tabIndex: PropTypes.string,
Expand Down
7 changes: 7 additions & 0 deletions constants/src/shared-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export const statusArgType = {
control: { type: 'boolean' },
}

export const buttonVariantArgType =
// No description because it should be set for the component description
{
table: { type: { summary: 'bool' } },
control: { type: 'boolean' },
}

/**
* Size variant propType
* @return {PropType} Mutually exclusive variants:
Expand Down

0 comments on commit d4dc535

Please sign in to comment.