Skip to content

Commit

Permalink
fix: added hasFocus as deprecated prop (#15571)
Browse files Browse the repository at this point in the history
* fix: added hasFocus as deprecated prop

* fix: removed hasfocus from default stories

* fix: fixed tabs space

* fix: added deprecated comment

* test: updated snapshots
  • Loading branch information
guidari committed Jan 26, 2024
1 parent 19b48f3 commit cb499c0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Expand Up @@ -109,9 +109,7 @@ Map {
"closeOnEscape": Object {
"type": "bool",
},
"hasFocus": Object {
"type": "bool",
},
"hasFocus": [Function],
"hideCloseButton": Object {
"type": "bool",
},
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/components/Notification/Notification.tsx
Expand Up @@ -843,6 +843,7 @@ export interface ActionableNotificationProps
closeOnEscape?: boolean;

/**
* @deprecated use StaticNotification once it's available. Issue #15532
* Specify if focus should be moved to the component when the notification contains actions
*/
hasFocus?: boolean;
Expand Down Expand Up @@ -1102,9 +1103,10 @@ ActionableNotification.propTypes = {
closeOnEscape: PropTypes.bool,

/**
* Deprecated, please use StaticNotification once it's available. Issue #15532
* Specify if focus should be moved to the component when the notification contains actions
*/
hasFocus: PropTypes.bool,
hasFocus: deprecate(PropTypes.bool),

/**
* Specify the close button should be disabled, or not
Expand Down
Expand Up @@ -40,6 +40,14 @@ export const Default = () => (
/>
);

Default.argTypes = {
hasFocus: {
table: {
disable: true,
},
},
};

export const Playground = (args) => <ActionableNotification {...args} />;

Playground.argTypes = {
Expand Down Expand Up @@ -72,6 +80,11 @@ Playground.argTypes = {
disable: true,
},
},
hasFocus: {
table: {
disable: true,
},
},
};
Playground.args = {
actionButtonLabel: 'Action',
Expand Down

0 comments on commit cb499c0

Please sign in to comment.