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

Move Menu to Future structure #5045

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .changeset/violet-cheetahs-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": minor
---

Move Menu v3 to Future
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react"
import { useIntl } from "@cultureamp/i18n-react-intl"
import { AddIcon } from "~components/Icon"
import { Menu, MenuList, MenuItem, Button } from "~components/__actions__/v2"
import { Menu, MenuList, MenuItem } from "~components/Menu"
import { Button } from "~components/__actions__/v2"
import { useFilterBarContext } from "../../context/FilterBarContext"

export const AddFiltersMenu = (): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as MenuStories from "./Menu.stories"

<Meta of={MenuStories} />

# Menu (v1)
# Menu

<ResourceLinks
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Menu"
Expand All @@ -15,11 +15,9 @@ import * as MenuStories from "./Menu.stories"

<Installation
installCommand="pnpm add @kaizen/components"
importStatement='import { Menu, MenuDropdown, MenuList, MenuItem } from "@kaizen/components/v1/actions"'
importStatement='import { Menu, MenuDropdown, MenuList, MenuItem } from "@kaizen/components"'
/>

It is recommended that you import from the `v2` entry point.

## Overview

A menu contains links to places or button actions. It does NOT show a selected item at all and the menu button text never changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Menu } from "../index"
import { MenuContentExample } from "./MenuContentExample"

export default {
title: "Actions/Menu/v1",
title: "Actions/Menu",
parameters: {
chromatic: { disable: false },
controls: { disable: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MenuItem } from "../subcomponents/MenuItem"
import { MenuList } from "../subcomponents/MenuList"

const meta = {
title: "Actions/Menu/v1",
title: "Actions/Menu",
component: Menu,
args: {
button: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
StatelessMenuProps as StatelessMenuPropsV1,
} from "./subcomponents/StatelessMenu"

// Note: deprecate all of these once we have Button v3
// Note: deprecate all of these once we have RAC Button

export const Menu = MenuV1
export type MenuProps = MenuPropsV1
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/SplitButton/SplitButton.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react"
import { screen, waitFor, render } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import { vi } from "vitest"
import { MenuItem, MenuList } from "~components/__actions__/v2"
import { MenuItem, MenuList } from "~components/Menu"
import { SplitButton, SplitButtonProps } from "./SplitButton"

const user = userEvent.setup()
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/SplitButton/SplitButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { HTMLAttributes } from "react"
import classnames from "classnames"
import { Menu } from "~components/__actions__/v2"
import { Menu } from "~components/Menu"
import { DataAttributes } from "~components/types/DataAttributes"
import { OverrideClassName } from "~components/types/OverrideClassName"
import { ActionButton, ActionButtonProps } from "./subcomponents/ActionButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
exampleActionButtonPropsAnchor,
exampleActionButtonPropsButton,
exampleDropdownContentEnabled,
} from "~components/__actions__/Menu/v1/_docs/examples"
} from "~components/Menu/_docs/examples"
import {
StickerSheet,
StickerSheetStory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
exampleActionButtonPropsButton,
exampleDropdownContentEnabled,
exampleDropdownContentOneDisabled,
} from "~components/__actions__/Menu/v1/_docs/examples"
} from "~components/Menu/_docs/examples"
import { SplitButton } from "../index"

const meta = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react"
import { ChevronDownIcon, MeatballsIcon } from "~components/Icon"
import { Menu, MenuList, Button, IconButton } from "~components/__actions__/v2"
import { Menu, MenuList } from "~components/Menu"
import { Button, IconButton } from "~components/__actions__/v2"
import { TITLE_BLOCK_ZEN_SECONDARY_MENU_HTML_ID } from "../constants"
import {
DefaultActionProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import React, { useCallback, useEffect, useState } from "react"
import classnames from "classnames"
import { FocusOn } from "react-focus-on"
import { ChevronDownIcon, ChevronUpIcon } from "~components/Icon"
import {
MenuItem,
MenuList,
MenuHeading,
ButtonProps,
} from "~components/__actions__/v2"
import { MenuItem, MenuList, MenuHeading } from "~components/Menu"
import { ButtonProps } from "~components/__actions__/v2"
import { TITLE_BLOCK_ZEN_OTHER_ACTIONS_HTML_ID } from "../constants"
import {
DefaultActionProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react"
import { ChevronDownIcon, MeatballsIcon } from "~components/Icon"
import { Menu, MenuList, Button, IconButton } from "~components/__actions__/v2"
import { Menu, MenuList } from "~components/Menu"
import { Button, IconButton } from "~components/__actions__/v2"
import styles from "../TitleBlockZen.module.scss"
import { TITLE_BLOCK_ZEN_SECONDARY_MENU_HTML_ID } from "../constants"
import { SecondaryActionsProps, TitleBlockMenuItemProps } from "../types"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import classnames from "classnames"
import { MenuItem } from "~components/__actions__/v2"
import { MenuItem } from "~components/Menu"
import { TitleBlockMenuItemProps } from "../types"
import styles from "./TitleBlockMenuItem.module.scss"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import React from "react"
import classnames from "classnames"
import { MenuProps, ButtonProps } from "~components/__actions__/v2"
import { MenuProps } from "~components/Menu"
import { ButtonProps } from "~components/__actions__/v2"
import styles from "./Toolbar.module.scss"

type ToolbarProps = {
Expand Down
7 changes: 2 additions & 5 deletions packages/components/src/TitleBlockZen/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { CompanyAvatarProps, GenericAvatarProps } from "~components/Avatar"
import { MenuItemProps } from "~components/Menu"
import { Select } from "~components/Select"
import {
ButtonProps,
CustomButtonProps,
MenuItemProps,
} from "~components/__actions__/v2"
import { ButtonProps, CustomButtonProps } from "~components/__actions__/v2"
import { NavigationTabProps } from "./subcomponents/NavigationTabs"

/**
Expand Down
27 changes: 0 additions & 27 deletions packages/components/src/__actions__/Menu/v2/_docs/Menu.mdx

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions packages/components/src/__actions__/Menu/v2/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/components/src/__actions__/v1.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./Menu/v1"
export * from "./Button/v1"
1 change: 0 additions & 1 deletion packages/components/src/__actions__/v2.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./Menu/v2"
export * from "./Button/v2"
1 change: 0 additions & 1 deletion packages/components/src/__actions__/v3.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./Menu/v3"
export * from "./Button/v3"
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { KAIOInstallation, ResourceLinks, SbContent } from "~storybook/componen
import * as docsStories from "./Menu.docs.stories"
import * as exampleStories from "./Menu.stories"

<Meta title="Actions/Menu/v3/API Specification"/>
<Meta title="Actions/Menu/Future/API Specification"/>

<SbContent>
# Menu API Specification (v3)
# Menu API Specification (Future)

Updated July 4, 2024
Updated Sep 9, 2024
</SbContent>

<ResourceLinks
Expand All @@ -22,15 +22,15 @@ import * as exampleStories from "./Menu.stories"
<div className="bg-yellow-100 border-default border-yellow-400 rounded px-24">
### Disclaimer

The `Menu` `v3` component is not backwards compatible with Kaizen `Button` `v1` and `v2`. For this reason, usage of this component is not recommended until a `Button` `v3` is released.
The Future `Menu` component is not backwards compatible with the current Kaizen `Button`. For this reason, usage of this component is not recommended until a Future `Button` is released.
</div>
</SbContent>

<SbContent className="mb-24">

<KAIOInstallation exportNames={["Menu", "MenuTrigger", "MenuItem"]} family="actions" version="3" />
<KAIOInstallation exportNames={["Menu", "MenuTrigger", "MenuItem"]}/>

<Source code={"import { Popover, Section, Header } from \"@kaizen/components/v3/react-aria-components\""} language="tsx" />
<Source code={"import { Popover, Section, Header } from \"react-aria-components\""} language="tsx" />

## Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Button } from "~components/__actions__/v3"
import { Menu, MenuItem, MenuTrigger } from "../index"

const meta = {
title: "Actions/Menu/v3/Docs Assets",
title: "Actions/Menu/Future/Docs Assets",
component: MenuTrigger,
args: {
defaultOpen: isChromatic(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { ResourceLinks, SbContent, Installation, DosAndDonts, DoOrDont } from "~
import * as MenuDocsStories from "./Menu.docs.stories"
import * as MenuStories from "./Menu.stories"

<Meta title="Actions/Menu/v3/Usage Guidelines" />
<Meta title="Actions/Menu/Future/Usage Guidelines" />

<SbContent>
# Menu (v3)
# Menu (future)

Updated July 6, 2024
</SbContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Button } from "~components/__actions__/v3"
import { Menu, MenuItem, MenuTrigger } from "../index"

const meta = {
title: "Actions/Menu/v3/Tests",
title: "Actions/Menu/Future/Tests",
component: MenuTrigger,
args: {
defaultOpen: isChromatic(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Menu, MenuTrigger, MenuItem } from "../index"
import * as testStories from "./Menu.spec.stories"

const meta = {
title: "Actions/Menu/v3",
title: "Actions/Menu/Future",
component: MenuTrigger,
args: {
defaultOpen: isChromatic(),
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from "./Label"
export * from "./LabelledMessage"
export * from "./LikertScaleLegacy"
export * from "./Loading"
export * from "./Menu"
export * from "./Modal"
export * from "./MultiSelect"
export * from "./Notification"
Expand Down Expand Up @@ -59,5 +60,4 @@ export * from "./VisuallyHidden"
export * from "./Well"
export * from "./__layout__/Workflow/v1"
export * from "./__overlays__/Tooltip/v1"
export * from "./__actions__/Menu/v1"
export * from "./__actions__/Button/v1"