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

feat: Remove Beta status from Header and deprecate Mega Menu #1814

Merged
merged 4 commits into from
Jan 17, 2025
Merged
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
1 change: 1 addition & 0 deletions packages/react/src/MegaMenu/MegaMenu.tsx
Original file line number Diff line number Diff line change
@@ -20,4 +20,5 @@ const MegaMenuRoot = forwardRef(

MegaMenuRoot.displayName = 'MegaMenu'

/** @deprecated Use child components in Header instead. */
Copy link
Contributor Author

@VincentSmedinga VincentSmedinga Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want this deprecation to appear in the change log. Where should we list it, under ‘Features’?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so. It's a deprecation of a feature.

export const MegaMenu = Object.assign(MegaMenuRoot, { ListCategory: MegaMenuListCategory })
3 changes: 0 additions & 3 deletions storybook/src/components/Header/Header.docs.mdx
Original file line number Diff line number Diff line change
@@ -3,12 +3,9 @@
import { Canvas, Controls, Markdown, Meta, Primary } from "@storybook/blocks";
import * as HeaderStories from "./Header.stories.tsx";
import README from "../../../../packages/css/src/components/header/README.md?raw";
import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta of={HeaderStories} />

<StatusBadge reason="Needs work for narrow screens and integration with Mega Menu." />

<Markdown>{README}</Markdown>

<Primary />
2 changes: 1 addition & 1 deletion storybook/src/components/Icon/Icon.docs.mdx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta of={IconStories} />

<StatusBadge reason="The set of available icon names and the component API will change." />
<StatusBadge description="The set of available icon names and the component API will change." />

<Markdown>{README}</Markdown>

2 changes: 1 addition & 1 deletion storybook/src/components/MegaMenu/MegaMenu.docs.mdx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta of={MegaMenuStories} />

<StatusBadge reason="Needs work for narrow screens and integration with Mega Menu." />
<StatusBadge status="deprecated" description="Use child components in Header instead." />

<Markdown>{README}</Markdown>

2 changes: 1 addition & 1 deletion storybook/src/components/PageMenu/PageMenu.docs.mdx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta of={PageMenuStories} />

<StatusBadge reason="May be affected by changes to Header and/or have its name changed." />
<StatusBadge description="Will be affected by changes to Header and/or have its name changed." />

<Markdown>{README}</Markdown>

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta of={TopTaskLinkStories} />

<StatusBadge reason="Will probably be removed in favour of Card." />
<StatusBadge description="Will probably be removed in favour of Card." />

<Markdown>{README}</Markdown>

12 changes: 7 additions & 5 deletions storybook/src/docs/components/StatusBadge.tsx
Original file line number Diff line number Diff line change
@@ -2,14 +2,16 @@ import './status-badge.css'
import { Badge } from '@amsterdam/design-system-react/src'

type StatusBadgeProps = {
/* Explains how the component must change to transition into another status. */
reason: string
/* Describes the reason for the status or suggests an alternative for a deprecated component. */
description: string
/* The status of the component. */
status: 'beta' | 'deprecated' | string
}

/** Indicates the status of a component. Use this to prepare implementers for API changes. */
export const StatusBadge = ({ reason }: StatusBadgeProps) => (
export const StatusBadge = ({ description, status = 'beta' }: StatusBadgeProps) => (
<span className="ams-storybook-status-badge">
<Badge color="orange" label="beta" />
<span>{reason}</span>
<Badge color={status === 'deprecated' ? 'red' : 'orange'} label={status} />
<span>{description}</span>
</span>
)
2 changes: 1 addition & 1 deletion storybook/src/foundation/assets/icons.docs.mdx
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta title="Brand/Assets/Icons" />

<StatusBadge reason="The set of available icons will change." />
<StatusBadge description="The set of available icons will change." />

# Icons

2 changes: 1 addition & 1 deletion storybook/src/foundation/design-tokens/colour.docs.mdx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { StatusBadge } from "../../docs/components/StatusBadge";

<Meta title="Brand/Design Tokens/Colour" />

<StatusBadge reason="The set of available colours and their names will change." />
<StatusBadge description="The set of available colours and their names will change." />

# Colour