@kaizen/components 1.68.13 → 1.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cjs/__actions__/Menu/v3/MenuHeader.cjs +22 -0
  2. package/dist/cjs/__actions__/Menu/v3/MenuPopover.cjs +22 -0
  3. package/dist/cjs/__actions__/Menu/v3/MenuSection.cjs +22 -0
  4. package/dist/cjs/__actions__/Menu/v3/MenuTrigger.cjs +1 -1
  5. package/dist/cjs/actionsV3.cjs +6 -0
  6. package/dist/esm/__actions__/Menu/v3/MenuHeader.mjs +17 -0
  7. package/dist/esm/__actions__/Menu/v3/MenuPopover.mjs +17 -0
  8. package/dist/esm/__actions__/Menu/v3/MenuSection.mjs +17 -0
  9. package/dist/esm/__actions__/Menu/v3/MenuTrigger.mjs +1 -1
  10. package/dist/esm/actionsV3.mjs +3 -0
  11. package/dist/styles.css +51 -51
  12. package/dist/types/__actions__/Menu/v3/MenuHeader.d.ts +8 -0
  13. package/dist/types/__actions__/Menu/v3/MenuPopover.d.ts +7 -0
  14. package/dist/types/__actions__/Menu/v3/MenuSection.d.ts +7 -0
  15. package/dist/types/__actions__/Menu/v3/MenuTrigger.d.ts +1 -1
  16. package/dist/types/__actions__/Menu/v3/index.d.ts +3 -0
  17. package/package.json +3 -3
  18. package/src/__actions__/Menu/v3/MenuHeader.tsx +12 -0
  19. package/src/__actions__/Menu/v3/MenuPopover.tsx +12 -0
  20. package/src/__actions__/Menu/v3/MenuSection.tsx +15 -0
  21. package/src/__actions__/Menu/v3/MenuTrigger.tsx +1 -1
  22. package/src/__actions__/Menu/v3/_docs/ApiSpecification.mdx +13 -43
  23. package/src/__actions__/Menu/v3/_docs/Menu.docs.stories.tsx +33 -31
  24. package/src/__actions__/Menu/v3/_docs/Menu.mdx +92 -155
  25. package/src/__actions__/Menu/v3/_docs/Menu.spec.stories.tsx +24 -25
  26. package/src/__actions__/Menu/v3/_docs/Menu.stories.tsx +39 -7
  27. package/src/__actions__/Menu/v3/index.ts +3 -0
@@ -1,11 +1,10 @@
1
1
  import React, { FunctionComponent } from 'react'
2
2
  import { Meta, StoryObj } from '@storybook/react'
3
3
  import isChromatic from 'chromatic'
4
- import { Popover } from 'react-aria-components'
5
4
  import { Text } from '~components/Text'
6
5
  import { Button } from '~components/__actions__/v3'
7
6
  import { Icon } from '~components/__future__/Icon'
8
- import { Menu, MenuTrigger, MenuItem } from '../index'
7
+ import { Menu, MenuTrigger, MenuItem, MenuPopover, MenuSection, MenuHeader } from '../index'
9
8
  import * as testStories from './Menu.spec.stories'
10
9
 
11
10
  const meta = {
@@ -15,7 +14,10 @@ const meta = {
15
14
  defaultOpen: isChromatic(),
16
15
  children: <></>,
17
16
  },
18
- subcomponents: { Menu, MenuItem } as Record<string, FunctionComponent<any>>,
17
+ subcomponents: { Menu, MenuItem, MenuPopover, MenuSection, MenuHeader } as Record<
18
+ string,
19
+ FunctionComponent<any>
20
+ >,
19
21
  } satisfies Meta<typeof MenuTrigger>
20
22
 
21
23
  export default meta
@@ -33,7 +35,7 @@ export const Playground: Story = {
33
35
  >
34
36
  Additional actions
35
37
  </Button>
36
- <Popover>
38
+ <MenuPopover>
37
39
  <Menu>
38
40
  <MenuItem icon={<Icon name="bookmark" isPresentational />}>Save</MenuItem>
39
41
  <MenuItem icon={<Icon name="edit" isPresentational isFilled />}>Edit</MenuItem>
@@ -41,7 +43,7 @@ export const Playground: Story = {
41
43
  <MenuItem icon={<Icon name="arrow_downward" isPresentational />}>Move down</MenuItem>
42
44
  <MenuItem icon={<Icon name="delete" isPresentational isFilled />}>Delete</MenuItem>
43
45
  </Menu>
44
- </Popover>
46
+ </MenuPopover>
45
47
  </MenuTrigger>
46
48
  ),
47
49
  }
@@ -71,7 +73,7 @@ export const RichContent: Story = {
71
73
  >
72
74
  Additional actions
73
75
  </Button>
74
- <Popover>
76
+ <MenuPopover>
75
77
  <Menu>
76
78
  <MenuItem textValue="Save">
77
79
  <div>Save</div>
@@ -92,7 +94,37 @@ export const RichContent: Story = {
92
94
  </Text>
93
95
  </MenuItem>
94
96
  </Menu>
95
- </Popover>
97
+ </MenuPopover>
98
+ </MenuTrigger>
99
+ ),
100
+ }
101
+
102
+ export const Sections: Story = {
103
+ render: ({ defaultOpen: _, ...args }) => (
104
+ <MenuTrigger {...args}>
105
+ <Button
106
+ size="large"
107
+ icon={<Icon name="more_horiz" isPresentational />}
108
+ variant="secondary"
109
+ hasHiddenLabel
110
+ >
111
+ Additional actions
112
+ </Button>
113
+ <MenuPopover>
114
+ <Menu>
115
+ <MenuSection>
116
+ <MenuHeader>Adjust</MenuHeader>
117
+ <MenuItem icon={<Icon name="bookmark" isPresentational />}>Save</MenuItem>
118
+ <MenuItem icon={<Icon name="edit" isPresentational isFilled />}>Edit</MenuItem>
119
+ </MenuSection>
120
+ <MenuSection>
121
+ <MenuHeader>Order</MenuHeader>
122
+ <MenuItem icon={<Icon name="arrow_upward" isPresentational />}>Move up</MenuItem>
123
+ <MenuItem icon={<Icon name="arrow_downward" isPresentational />}>Move down</MenuItem>
124
+ <MenuItem icon={<Icon name="delete" isPresentational isFilled />}>Delete</MenuItem>
125
+ </MenuSection>
126
+ </Menu>
127
+ </MenuPopover>
96
128
  </MenuTrigger>
97
129
  ),
98
130
  }
@@ -1,3 +1,6 @@
1
1
  export * from './Menu'
2
2
  export * from './MenuItem'
3
3
  export * from './MenuTrigger'
4
+ export * from './MenuPopover'
5
+ export * from './MenuSection'
6
+ export * from './MenuHeader'