@kaizen/components 1.38.2 → 1.38.3
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.
- package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs +1 -1
- package/dist/cjs/TitleBlockZen/subcomponents/MainActions.cjs.map +1 -1
- package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs +4 -4
- package/dist/cjs/TitleBlockZen/subcomponents/MobileActions.cjs.map +1 -1
- package/dist/cjs/TitleBlockZen/subcomponents/TitleBlockMenuItem.cjs.map +1 -1
- package/dist/cjs/TitleBlockZen/utils.cjs.map +1 -1
- package/dist/cjs/dts/TitleBlockZen/subcomponents/MainActions.d.ts +1 -2
- package/dist/cjs/dts/TitleBlockZen/subcomponents/MobileActions.d.ts +1 -2
- package/dist/cjs/dts/TitleBlockZen/subcomponents/TitleBlockMenuItem.d.ts +1 -5
- package/dist/cjs/dts/TitleBlockZen/types.d.ts +1 -3
- package/dist/cjs/dts/TitleBlockZen/utils.d.ts +0 -2
- package/dist/cjs/index.css +3 -3
- package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs +1 -1
- package/dist/esm/TitleBlockZen/subcomponents/MainActions.mjs.map +1 -1
- package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs +4 -4
- package/dist/esm/TitleBlockZen/subcomponents/MobileActions.mjs.map +1 -1
- package/dist/esm/TitleBlockZen/subcomponents/TitleBlockMenuItem.mjs.map +1 -1
- package/dist/esm/TitleBlockZen/utils.mjs.map +1 -1
- package/dist/esm/dts/TitleBlockZen/subcomponents/MainActions.d.ts +1 -2
- package/dist/esm/dts/TitleBlockZen/subcomponents/MobileActions.d.ts +1 -2
- package/dist/esm/dts/TitleBlockZen/subcomponents/TitleBlockMenuItem.d.ts +1 -5
- package/dist/esm/dts/TitleBlockZen/types.d.ts +1 -3
- package/dist/esm/dts/TitleBlockZen/utils.d.ts +0 -2
- package/dist/esm/index.css +2 -2
- package/dist/index.d.ts +1 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/TitleBlockZen/_docs/TitleBlockZen.stories.tsx +0 -2
- package/src/TitleBlockZen/subcomponents/MainActions.tsx +6 -5
- package/src/TitleBlockZen/subcomponents/MobileActions.spec.tsx +2 -2
- package/src/TitleBlockZen/subcomponents/MobileActions.tsx +6 -8
- package/src/TitleBlockZen/subcomponents/TitleBlockMenuItem.tsx +2 -8
- package/src/TitleBlockZen/types.ts +1 -3
- package/src/TitleBlockZen/utils.ts +0 -5
package/package.json
CHANGED
|
@@ -51,12 +51,10 @@ const meta = {
|
|
|
51
51
|
secondaryActions: SECONDARY_ACTIONS,
|
|
52
52
|
secondaryOverflowMenuItems: [
|
|
53
53
|
{
|
|
54
|
-
action: (): void => alert("test"),
|
|
55
54
|
label: "Overflow action 1",
|
|
56
55
|
icon: <StarOnIcon role="presentation" />,
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
|
-
action: "#",
|
|
60
58
|
label: "Overflow link 1",
|
|
61
59
|
icon: <StarOnIcon role="presentation" />,
|
|
62
60
|
},
|
|
@@ -2,12 +2,13 @@ import React from "react"
|
|
|
2
2
|
import { Button, IconButton } from "~components/Button"
|
|
3
3
|
import { ChevronDownIcon, MeatballsIcon } from "~components/Icon"
|
|
4
4
|
import { Menu, MenuList } from "~components/Menu"
|
|
5
|
-
import { DefaultActionProps, PrimaryActionProps } from "../types"
|
|
6
|
-
import { isMenuGroupNotButton } from "../utils"
|
|
7
5
|
import {
|
|
8
|
-
|
|
6
|
+
DefaultActionProps,
|
|
7
|
+
PrimaryActionProps,
|
|
9
8
|
TitleBlockMenuItemProps,
|
|
10
|
-
} from "
|
|
9
|
+
} from "../types"
|
|
10
|
+
import { isMenuGroupNotButton } from "../utils"
|
|
11
|
+
import { TitleBlockMenuItem } from "./TitleBlockMenuItem"
|
|
11
12
|
import { Toolbar } from "./Toolbar"
|
|
12
13
|
import styles from "./MainActions.module.scss"
|
|
13
14
|
|
|
@@ -32,7 +33,7 @@ export const MainActions = ({
|
|
|
32
33
|
<TitleBlockMenuItem
|
|
33
34
|
{...item}
|
|
34
35
|
key={`main-action-primary-menu-item-${idx}`}
|
|
35
|
-
|
|
36
|
+
data-automation-id={`main-action-primary-menu-item-${idx}`}
|
|
36
37
|
data-testid={`main-action-primary-menu-item-${idx}`}
|
|
37
38
|
/>
|
|
38
39
|
))
|
|
@@ -8,11 +8,11 @@ const user = userEvent.setup()
|
|
|
8
8
|
const MENU_LINKS = [
|
|
9
9
|
{
|
|
10
10
|
label: "Primary menu link 1",
|
|
11
|
-
|
|
11
|
+
href: "#",
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
label: "Primary menu action 2",
|
|
15
|
-
|
|
15
|
+
onClick: (): void => alert("test"),
|
|
16
16
|
},
|
|
17
17
|
]
|
|
18
18
|
|
|
@@ -10,15 +10,13 @@ import {
|
|
|
10
10
|
SecondaryActionsProps,
|
|
11
11
|
TitleBlockButtonProps,
|
|
12
12
|
TitleBlockMenuGroup,
|
|
13
|
+
TitleBlockMenuItemProps,
|
|
13
14
|
} from "../types"
|
|
14
15
|
import {
|
|
15
16
|
convertSecondaryActionsToMenuItems,
|
|
16
17
|
isMenuGroupNotButton,
|
|
17
18
|
} from "../utils"
|
|
18
|
-
import {
|
|
19
|
-
TitleBlockMenuItem,
|
|
20
|
-
TitleBlockMenuItemProps,
|
|
21
|
-
} from "./TitleBlockMenuItem"
|
|
19
|
+
import { TitleBlockMenuItem } from "./TitleBlockMenuItem"
|
|
22
20
|
|
|
23
21
|
import styles from "./MobileActions.module.scss"
|
|
24
22
|
|
|
@@ -57,7 +55,7 @@ const renderPrimaryActionDrawerContent = (
|
|
|
57
55
|
<TitleBlockMenuItem
|
|
58
56
|
{...item}
|
|
59
57
|
key={`title-block-mobile-actions-primary-${itemType}-${idx}`}
|
|
60
|
-
|
|
58
|
+
data-automation-id={`title-block-mobile-actions-primary-${itemType}-${idx}`}
|
|
61
59
|
data-testid={`title-block-mobile-actions-primary-${itemType}-${idx}`}
|
|
62
60
|
/>
|
|
63
61
|
)
|
|
@@ -76,7 +74,7 @@ const renderDefaultLink = (
|
|
|
76
74
|
<TitleBlockMenuItem
|
|
77
75
|
{...defaultAction}
|
|
78
76
|
key="title-block-mobile-actions-default-link"
|
|
79
|
-
|
|
77
|
+
data-automation-id="title-block-mobile-actions-default-link"
|
|
80
78
|
data-testid="title-block-mobile-actions-default-link"
|
|
81
79
|
/>
|
|
82
80
|
)
|
|
@@ -88,7 +86,7 @@ const renderDefaultLink = (
|
|
|
88
86
|
icon={defaultAction.icon}
|
|
89
87
|
disabled={defaultAction.disabled}
|
|
90
88
|
key="title-block-mobile-actions-default-link"
|
|
91
|
-
|
|
89
|
+
data-automation-id="title-block-mobile-actions-default-link"
|
|
92
90
|
data-testid="title-block-mobile-actions-default-link"
|
|
93
91
|
/>
|
|
94
92
|
)
|
|
@@ -102,7 +100,7 @@ const renderDefaultAction = (
|
|
|
102
100
|
<TitleBlockMenuItem
|
|
103
101
|
{...defaultAction}
|
|
104
102
|
key="title-block-mobile-actions-default-action"
|
|
105
|
-
|
|
103
|
+
data-automation-id="title-block-mobile-actions-default-action"
|
|
106
104
|
data-testid="title-block-mobile-actions-default-action"
|
|
107
105
|
/>
|
|
108
106
|
)
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import classnames from "classnames"
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { MenuItem } from "~components/Menu"
|
|
4
|
+
import { TitleBlockMenuItemProps } from "../types"
|
|
5
5
|
import styles from "./TitleBlockMenuItem.module.scss"
|
|
6
6
|
|
|
7
|
-
export type TitleBlockMenuItemProps =
|
|
8
|
-
| ({
|
|
9
|
-
component: (props: CustomButtonProps) => JSX.Element
|
|
10
|
-
} & MenuItemProps)
|
|
11
|
-
| MenuItemProps
|
|
12
|
-
|
|
13
7
|
export const TitleBlockMenuItem = (
|
|
14
8
|
props: TitleBlockMenuItemProps
|
|
15
9
|
): JSX.Element => {
|
|
@@ -125,9 +125,7 @@ export type TitleBlockCustomButtonProps = TitleBlockDistributiveOmit<
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
export type TitleBlockMenuItemProps =
|
|
128
|
-
|
|
|
129
|
-
action: ((e: any) => void) | string
|
|
130
|
-
})
|
|
128
|
+
| MenuItemProps
|
|
131
129
|
| TitleBlockCustomButtonProps
|
|
132
130
|
|
|
133
131
|
export type ButtonWithHrefNotOnClick = TitleBlockDistributiveOmit<
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MenuItemProps } from "~components/Menu"
|
|
2
1
|
import {
|
|
3
2
|
TitleBlockButtonProps,
|
|
4
3
|
TitleBlockCustomButtonProps,
|
|
@@ -8,10 +7,6 @@ import {
|
|
|
8
7
|
TitleBlockMenuItemProps,
|
|
9
8
|
} from "./types"
|
|
10
9
|
|
|
11
|
-
export const isMenuItemNotButton = (
|
|
12
|
-
value: TitleBlockButtonProps | MenuItemProps
|
|
13
|
-
): value is MenuItemProps => "action" in value
|
|
14
|
-
|
|
15
10
|
export const isMenuGroupNotButton = (
|
|
16
11
|
value:
|
|
17
12
|
| (TitleBlockButtonProps | TitleBlockCustomButtonProps)
|