Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate empty state v2 #6430

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/components/EmptyState/EmptyStateV2-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('EmptyStateV2 @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'EmptyStateV2',
id: 'experimental-patterns-empty-state-emptystatev2--default',
id: 'deprecated-empty-state-emptystatev2--default',
globals: {
carbonTheme: 'white',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { Add } from '@carbon/react/icons';
import CustomIllustration from './story_assets/empty-state-bright-magnifying-glass.svg';
import { EmptyStateV2 } from '.';
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
import { Annotation } from '../../../../core/.storybook/Annotation';

export default {
title: 'Experimental/Patterns/Empty state/EmptyStateV2',
title: 'Deprecated/Empty state/EmptyStateV2',
component: EmptyStateV2,
tags: ['autodocs'],
parameters: {
Expand All @@ -30,10 +31,32 @@ export default {
label: 'Carbon empty pattern usage guidelines',
},
]}
deprecationNotice="This component is deprecated and will be removed in the next major version. For more information, please refer to the [Carbon docs](https://carbondesignsystem.com/patterns/empty-states-pattern/)."
/>
),
},
},
decorators: [
(story) => (
<div>
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version. For more information, please refer to the{' '}
<a href="https://carbondesignsystem.com/patterns/empty-states-pattern/">
Carbon docs
</a>
.
</div>
}
>
{story()}
</Annotation>
</div>
),
],
};

const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export interface EmptyStateV2Props {
/**
* This is the V2 version of the `EmptyState` component. To use you must pass the `v2` prop to the V1 version of the component `EmptyState` and use the props below.
* In order to avoid breaking changes in the future `EmptyStateV2` is not actually directly importable.
* @deprecated
*/

export let EmptyStateV2 = React.forwardRef<HTMLDivElement, EmptyStateV2Props>(
Expand Down Expand Up @@ -180,6 +181,13 @@ export let EmptyStateV2 = React.forwardRef<HTMLDivElement, EmptyStateV2Props>(
}
);

/**@ts-ignore*/
EmptyStateV2.deprecated = {
level: 'warn',
details:
'For more information, please refer to the Carbon docs https://carbondesignsystem.com/patterns/empty-states-pattern/',
};

// Return a placeholder if not released and not enabled by feature flag
EmptyStateV2 = pkg.checkComponentEnabled(EmptyStateV2, componentName);

Expand Down
Loading