Skip to content

Commit ee09cfe

Browse files
committed
2 parents 29b33f5 + 6675716 commit ee09cfe

File tree

11 files changed

+56
-15
lines changed

11 files changed

+56
-15
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,18 @@ jobs:
8686
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
8787
run: yarn publish:ci
8888

89+
# Post breaking changes to a Slack channel is temporarily disabled
90+
# since the Slack webhook URL is not available in the workflow environment
8991
# Step 12: Post breaking changes to a Slack channel
90-
- name: Post breaking changes to a Slack channel
91-
env:
92-
SLACK_WEBHOOK_URL: ${{ secrets.SDS_BREAKING_CHANGES_SLACK_WEBHOOK }}
93-
uses: act10ns/slack@v1
94-
with:
95-
status: complete
96-
channel: "#sci-design-system-breaking-changes"
97-
config: .github/config/slack.yml
98-
if: contains(toJson(github.event.commits.*.message), 'BREAKING CHANGE')
92+
# - name: Post breaking changes to a Slack channel
93+
# env:
94+
# SLACK_WEBHOOK_URL: ${{ secrets.SDS_BREAKING_CHANGES_SLACK_WEBHOOK }}
95+
# uses: act10ns/slack@v1
96+
# with:
97+
# status: complete
98+
# channel: "#sci-design-system-breaking-changes"
99+
# config: .github/config/slack.yml
100+
# if: contains(toJson(github.event.commits.*.message), 'BREAKING CHANGE')
99101

100102
# Step 13: Merge prod branch into main
101103
- name: Create PR to merge prod into main

packages/components/src/core/NavigationHeader/NavigationHeader.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export interface NavigationHeaderProps<T extends string = string>
2929
setDrawerOpen?: (open: boolean) => void;
3030
menuProps?: Partial<MenuProps>;
3131
sdsStyle?: "dropdown" | "drawer";
32+
onDrawerStyleNavItemHover?: (
33+
item:
34+
| NavigationHeaderPrimaryNavItem<T>
35+
| NavigationHeaderSecondaryNavItem<T>
36+
) => void;
3237
isSticky?: boolean;
3338
topComponentSlot?: ReactNode;
3439
}

packages/components/src/core/NavigationHeader/__storybook__/stories/drawerStyle.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,19 @@ export const DrawerStyleDemo = (
117117
return (
118118
<>
119119
<RawNavigationHeader
120-
{...rest}
121120
primaryNavItems={primaryNavItems}
122121
secondaryNavItems={secondaryNavItems}
123122
backgroundAppearance={backgroundAppearance}
124123
title={title}
125124
activePrimaryNavKey={activePrimaryNavKey}
126125
setActivePrimaryNavKey={setActivePrimaryNavKey}
126+
onDrawerStyleNavItemHover={(item) => {
127+
console.log(
128+
"NavigationHeader onDrawerStyleNavItemHover called with item:",
129+
item
130+
);
131+
}}
132+
{...rest}
127133
/>
128134
<Container>
129135
<Box>

packages/components/src/core/NavigationHeader/__tests__/index.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ describe("<NavigationHeader />", () => {
116116
expect(onClickMock).toHaveBeenCalled();
117117
});
118118

119+
it("triggers onDrawerStyleNavItemHover when hovering over a drawer item", () => {
120+
const onDrawerStyleNavItemHover = jest.fn();
121+
const { DrawerStyle } = composeStories(stories);
122+
123+
render(
124+
<DrawerStyle onDrawerStyleNavItemHover={onDrawerStyleNavItemHover} />
125+
);
126+
127+
const productsItem = screen.getAllByText("Products")[0];
128+
fireEvent.mouseEnter(productsItem);
129+
130+
expect(onDrawerStyleNavItemHover).toHaveBeenCalled();
131+
});
132+
119133
it("matches the snapshot", () => {
120134
const { asFragment } = render(<DropdownStyle />);
121135
expect(asFragment()).toMatchSnapshot();

packages/components/src/core/NavigationHeader/components/NavigationHeaderPrimaryNav/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export interface NavigationHeaderPrimaryNavProps<T extends string> {
9595
onDrawerStateChange?: (isOpen: boolean) => void;
9696
topOffset?: number;
9797
onClose?: () => void;
98+
onDrawerStyleNavItemHover?: (item: NavigationHeaderPrimaryNavItem<T>) => void;
9899
}
99100

100101
export default function NavigationHeaderPrimaryNav<T extends string>({
@@ -112,6 +113,7 @@ export default function NavigationHeaderPrimaryNav<T extends string>({
112113
onDrawerStateChange,
113114
topOffset = 0,
114115
onClose: onCloseProp,
116+
onDrawerStyleNavItemHover,
115117
}: NavigationHeaderPrimaryNavProps<T>) {
116118
const theme: SDSTheme = useTheme();
117119

@@ -202,6 +204,7 @@ export default function NavigationHeaderPrimaryNav<T extends string>({
202204
<StyledHoverDrawerContainer
203205
key={key}
204206
onMouseEnter={() => {
207+
onDrawerStyleNavItemHover?.(item);
205208
if (clickedDrawerKey !== key) {
206209
onDrawerOpen(key);
207210
}

packages/components/src/core/NavigationHeader/components/NavigationHeaderSecondaryNav/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export interface NavigationHeaderSecondaryNavProps<T extends string> {
6868
onDrawerStateChange?: (isOpen: boolean) => void;
6969
topOffset?: number;
7070
onClose?: () => void;
71+
onDrawerStyleNavItemHover?: (
72+
item: NavigationHeaderSecondaryNavItem<T>
73+
) => void;
7174
}
7275

7376
export default function NavigationHeaderSecondaryNav<T extends string>({
@@ -83,6 +86,7 @@ export default function NavigationHeaderSecondaryNav<T extends string>({
8386
onDrawerStateChange,
8487
topOffset = 0,
8588
onClose: onCloseProp,
89+
onDrawerStyleNavItemHover,
8690
}: NavigationHeaderSecondaryNavProps<T>) {
8791
const theme: SDSTheme = useTheme();
8892

@@ -141,7 +145,10 @@ export default function NavigationHeaderSecondaryNav<T extends string>({
141145
return (
142146
<StyledHoverDrawerContainer
143147
key={key}
144-
onMouseEnter={() => onDrawerOpen(key)}
148+
onMouseEnter={() => {
149+
onDrawerStyleNavItemHover?.(item);
150+
onDrawerOpen(key);
151+
}}
145152
onMouseLeave={onDrawerClose}
146153
>
147154
<UnifiedNavItem

packages/components/src/core/NavigationHeader/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const NavigationHeader = forwardRef<HTMLDivElement, NavigationHeaderProps>(
7676
setDrawerOpen: onDrawerOpenChange,
7777
isSticky = true,
7878
topComponentSlot,
79+
onDrawerStyleNavItemHover,
7980
...rest
8081
} = props;
8182
const navRef = useRef<HTMLDivElement>(null);
@@ -314,7 +315,7 @@ const NavigationHeader = forwardRef<HTMLDivElement, NavigationHeaderProps>(
314315
primaryNavItems.length > 0 && (
315316
<NavigationHeaderPrimaryNav
316317
items={primaryNavItems}
317-
value={activePrimaryNavKey}
318+
value={activePrimaryNavKey as T}
318319
onChange={setActivePrimaryNavKey}
319320
hasInvertedStyle={hasInvertedStyle}
320321
isNarrow={dimensions.isNarrow}
@@ -327,6 +328,7 @@ const NavigationHeader = forwardRef<HTMLDivElement, NavigationHeaderProps>(
327328
onDrawerStateChange={handlePrimaryDrawerStateChange}
328329
topOffset={topOffset}
329330
onClose={() => setDrawerOpen(false)}
331+
onDrawerStyleNavItemHover={onDrawerStyleNavItemHover}
330332
/>
331333
)
332334
);
@@ -349,6 +351,7 @@ const NavigationHeader = forwardRef<HTMLDivElement, NavigationHeaderProps>(
349351
onDrawerStateChange={handleSecondaryDrawerStateChange}
350352
topOffset={topOffset}
351353
onClose={() => setDrawerOpen(false)}
354+
onDrawerStyleNavItemHover={onDrawerStyleNavItemHover}
352355
/>
353356
)
354357
);

packages/components/src/core/styles/common/makeThemeOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ export function makeThemeOptions(
535535
appTheme.spacing.l,
536536
appTheme.spacing.xl,
537537
appTheme.spacing.xxl,
538+
appTheme.spacing.xxxl,
538539
],
539540
transitions: {
540541
duration: {

packages/mcp/data/component-props/Banner.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"isRequired": false
1515
},
1616
"intent": {
17-
"type": "\"info\" | \"negative\" | \"notice\" | \"positive\"",
17+
"type": "\"accent\" | \"info\" | \"negative\" | \"notice\" | \"positive\"",
1818
"isRequired": false
1919
},
2020
"sdsIconProps": {

packages/mcp/data/component-props/Callout.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"description": "Override the icon displayed before the children.\nUnless provided, the icon is mapped to the value of the `severity` prop.\nSet to `false` to remove the `icon`."
2424
},
2525
"intent": {
26-
"type": "\"info\" | \"negative\" | \"notice\" | \"positive\"",
26+
"type": "\"info\" | \"accent\" | \"negative\" | \"notice\" | \"positive\"",
2727
"isRequired": true
2828
},
2929
"sdsStyle": {

0 commit comments

Comments
 (0)