-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1e4b81
commit 5af99dd
Showing
65 changed files
with
550 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kaizen/components": minor | ||
--- | ||
|
||
v3 Menu component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/components/src/Filter/FilterBar/subcomponents/AddFiltersMenu/AddFiltersMenu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/components/src/TitleBlockZen/subcomponents/MainActions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/components/src/TitleBlockZen/subcomponents/SecondaryActions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/components/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
packages/components/src/__actions__/Menu/v1/_docs/Menu.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Canvas, Controls, Meta } from "@storybook/blocks" | ||
import { ResourceLinks, Installation } from "~storybook/components" | ||
import * as MenuStories from "./Menu.stories" | ||
|
||
<Meta of={MenuStories} /> | ||
|
||
# Menu (v1) | ||
|
||
<ResourceLinks | ||
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Menu" | ||
figma="https://www.figma.com/file/ZRfnoNUXbGZv4eVWLbF4Az/%EF%B8%8F%F0%9F%96%BC%EF%B8%8F-Component-Gallery?node-id=9%3A39909&t=P1w10jr2cpPuaayw-1" | ||
designGuidelines="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082059782/Menu" | ||
className="!mb-8" | ||
/> | ||
|
||
<Installation | ||
installCommand="pnpm add @kaizen/components" | ||
importStatement='import { Menu, MenuDropdown, MenuList, MenuItem } from "@kaizen/components/v1/actions"' | ||
/> | ||
|
||
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. | ||
|
||
<Canvas of={MenuStories.Playground} /> | ||
<Controls of={MenuStories.Playground} /> | ||
|
||
## API | ||
|
||
Coming soon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/components/src/Menu/_docs/examples.tsx → ...rc/__actions__/Menu/v1/_docs/examples.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Since we can't add a deprecation flag on a * export | ||
import { Menu as MenuV1, MenuProps as MenuPropsV1 } from "./Menu" | ||
import { | ||
MenuHeading as MenuHeadingV1, | ||
MenuHeadingProps as MenuHeadingPropsV1, | ||
} from "./subcomponents/MenuHeading" | ||
import { | ||
MenuItem as MenuItemV1, | ||
MenuItemProps as MenuItemPropsV1, | ||
} from "./subcomponents/MenuItem" | ||
import { | ||
MenuList as MenuListV1, | ||
MenuListProps as MenuListPropsV1, | ||
} from "./subcomponents/MenuList" | ||
import { | ||
StatelessMenu as StatelessMenuV1, | ||
StatelessMenuProps as StatelessMenuPropsV1, | ||
} from "./subcomponents/StatelessMenu" | ||
|
||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export const Menu = MenuV1 | ||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export type MenuProps = MenuPropsV1 | ||
|
||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export const MenuHeading = MenuHeadingV1 | ||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export type MenuHeadingProps = MenuHeadingPropsV1 | ||
|
||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export const MenuItem = MenuItemV1 | ||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export type MenuItemProps = MenuItemPropsV1 | ||
|
||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export const MenuList = MenuListV1 | ||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export type MenuListProps = MenuListPropsV1 | ||
|
||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export const StatelessMenu = StatelessMenuV1 | ||
/** * @deprecated use v2 or upgrade to v3 for the latest release */ | ||
export type StatelessMenuProps = StatelessMenuPropsV1 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/components/src/__actions__/Menu/v2/_docs/Menu.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from "react" | ||
import { Meta, StoryObj } from "@storybook/react" | ||
import { Button } from "~components/Button" | ||
import { ChevronDownIcon, DuplicateIcon } from "~components/Icon" | ||
import * as MenuV1Stories from "../../v1/_docs/Menu.stories" | ||
import { Menu, MenuList, MenuItem, MenuHeading } from "../index" | ||
|
||
const meta = { | ||
title: "Actions/Menu/v2", | ||
component: Menu, | ||
args: { | ||
button: ( | ||
<Button | ||
label="Actions" | ||
icon={<ChevronDownIcon role="presentation" />} | ||
iconPosition="end" | ||
/> | ||
), | ||
children: ( | ||
<MenuList> | ||
<MenuItem | ||
onClick={() => { | ||
alert("Duplicated!") | ||
}} | ||
icon={<DuplicateIcon role="presentation" />} | ||
label="Duplicate item" | ||
/> | ||
<MenuList heading={<MenuHeading>Extra links</MenuHeading>}> | ||
<MenuItem | ||
href="https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082059782/Menu" | ||
label="Learn more about Menu" | ||
/> | ||
</MenuList> | ||
</MenuList> | ||
), | ||
}, | ||
decorators: [ | ||
Story => ( | ||
<div className="flex mt-[60px] gap-12"> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
} satisfies Meta<typeof Menu> | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Playground: Story = MenuV1Stories.Playground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from "../v1/Menu" | ||
export * from "../v1/subcomponents/MenuList" | ||
export * from "../v1/subcomponents/MenuDropdown" | ||
export * from "../v1/subcomponents/MenuItem" | ||
export * from "../v1/subcomponents/MenuHeading" | ||
export * from "../v1/subcomponents/StatelessMenu" |
16 changes: 16 additions & 0 deletions
16
packages/components/src/__actions__/Menu/v3/Menu.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import "~@kaizen/design-tokens/sass/border"; | ||
@import "~@kaizen/design-tokens/sass/color"; | ||
@import "~@kaizen/design-tokens/sass/shadow"; | ||
@import "~@kaizen/design-tokens/sass/spacing"; | ||
|
||
.menu { | ||
background-color: $color-white; | ||
color: $color-purple-800; | ||
width: 248px; | ||
max-height: 22rem; | ||
overflow: auto; | ||
padding-block: $spacing-xs; | ||
outline: none; | ||
border-radius: $border-solid-border-radius; | ||
box-shadow: $shadow-large-box-shadow; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react" | ||
import { | ||
Menu as RACMenu, | ||
MenuProps as RACMenuProps, | ||
} from "react-aria-components" | ||
import styles from "./Menu.module.scss" | ||
|
||
export type MenuProps = Omit< | ||
// @todo: what does it want here instead of any? | ||
RACMenuProps<any>, | ||
| "selectionMode" | ||
| "disallowEmptySelection" | ||
| "selectedKeys" | ||
| "defaultSelectedKeys" | ||
> | ||
|
||
/** | ||
* | ||
*/ | ||
export const Menu = (props: MenuProps): JSX.Element => ( | ||
<RACMenu className={styles.menu} {...props} /> | ||
) |
12 changes: 12 additions & 0 deletions
12
packages/components/src/__actions__/Menu/v3/MenuHeader.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import "~@kaizen/design-tokens/sass/spacing"; | ||
@import "~@kaizen/design-tokens/sass/typography"; | ||
|
||
.header { | ||
font-family: $typography-heading-6-font-family; | ||
font-size: $typography-heading-6-font-size; | ||
letter-spacing: $typography-heading-6-letter-spacing; | ||
font-weight: $typography-heading-6-font-weight; | ||
line-height: $typography-heading-6-line-height; | ||
padding: $spacing-6 10px; | ||
margin-inline: $spacing-xs; | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/components/src/__actions__/Menu/v3/MenuHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react" | ||
import { Header } from "react-aria-components" | ||
import styles from "./MenuHeader.module.scss" | ||
|
||
type MenuHeaderProps = { | ||
children: any | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
export const MenuHeader = (props: MenuHeaderProps): JSX.Element => ( | ||
<Header className={styles.header} {...props} /> | ||
) |
Oops, something went wrong.