Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
1 change: 1 addition & 0 deletions .github/workflows/publish-rc-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ concurrency:
group: publish-rc-packages
cancel-in-progress: false


jobs:
publish-rc-packages:
runs-on: ubuntu-latest
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
"@commitlint/config-conventional": "^17.2.0",
"@jest/types": "^29.2.1",
"@mdx-js/react": "^3.0.0",
"@nimbus-ds/components": "5.56.1",
"@nimbus-ds/components": "5.57.7-rc.2",
"@nimbus-ds/icons": "^1.15.1",
"@nimbus-ds/scripts": "^1.8.2",
"@nimbus-ds/styles": "9.61.1",
"@nimbus-ds/tokens": "^9.5.0",
"@nimbus-ds/styles": "9.62.7-rc.2",
"@nimbus-ds/tokens": "9.5.3-rc.5",
"@storybook/addon-docs": "^8.6.14",
"@storybook/addon-essentials": "^8.6.14",
"@storybook/addon-interactions": "^8.6.14",
Expand Down Expand Up @@ -127,6 +127,9 @@
},
"packageManager": "yarn@3.2.2",
"resolutions": {
"typescript-json-schema": "patch:typescript-json-schema@npm%3A0.55.0#./.yarn/patches/typescript-json-schema-npm-0.55.0-8fc27dfa81.patch"
"typescript-json-schema": "patch:typescript-json-schema@npm%3A0.55.0#./.yarn/patches/typescript-json-schema-npm-0.55.0-8fc27dfa81.patch",
"@nimbus-ds/styles": "9.62.7-rc.2",
"@nimbus-ds/tokens": "9.5.3-rc.5",
"@nimbus-ds/components": "5.57.7-rc.2"
}
}
2 changes: 1 addition & 1 deletion packages/react/src/components/AppShell/src/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const AppShell: React.FC<AppShellProps> & AppShellComponents = ({
flex="1 1 auto"
height="100vh"
width="100%"
backgroundColor="neutral-surface"
backgroundColor="neutral-surfaceDisabled"
// Fully customizable due to client needs
{...contentProperties}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const AppMenu = ({ menuExpanded }: { menuExpanded: boolean }) => {
<Menu expanded={expanded}>
<Menu.Header>
{expanded ? (
<Icon source={tiendanubeLogo} color="primary-interactive" />
<Icon source={tiendanubeLogo} color="neutral-textHigh" />
) : (
<Icon
source={<TiendanubeIcon size={24} />}
Expand Down Expand Up @@ -226,7 +226,7 @@ const CollapsibleAppMenu = ({
justifyContent="space-between"
width="100%"
>
<Icon source={tiendanubeLogo} color="primary-interactive" />
<Icon source={tiendanubeLogo} color="neutral-textHigh" />
<Tooltip content="Close menu" arrow position="right">
<Box
backgroundColor={{ hover: "primary-surface" }}
Expand Down Expand Up @@ -484,7 +484,7 @@ export const collapsibleMenuClick: Story = {
justifyContent="space-between"
width="100%"
>
<Icon source={tiendanubeLogo} color="primary-interactive" />
<Icon source={tiendanubeLogo} color="neutral-textHigh" />
<Box
backgroundColor={{ hover: "primary-surface" }}
borderRadius="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AppShellHeader: React.FC<AppShellHeaderProps> = ({
}: AppShellHeaderProps) => (
<Box
padding="2"
backgroundColor="neutral-surface"
backgroundColor="neutral-surfaceDisabled"
gap="2"
{...rest}
display="flex"
Expand Down
8 changes: 0 additions & 8 deletions packages/react/src/components/Menu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ The Menu component allows the user to create in-app menus that navigate through

- Add props documentation. ([#26](https://github.com/TiendaNube/nimbus-patterns/pull/26) by [@juanchigallego](https://github.com/juanchigallego))

## 2023-04-04 `1.2.0`

#### 📚 3rd party library updates

- Updated `@nimbus-ds/components@4.x`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
- Updated `@nimbus-ds/icons@1.x`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
- Removed `@nimbus-ds/styles@7.0.0`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))

## 2023-02-17 `1.1.0`

### 🎉 New features
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Menu/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Menu: React.FC<MenuProps> & MenuComponents = ({
display="flex"
flexDirection="column"
height="100%"
backgroundColor="neutral-background"
backgroundColor="neutral-surfaceHighlight"
boxSizing="border-box"
{...dynamicProps}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Menu/src/menu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("GIVEN <Menu />", () => {
});
});

describe("WHEN tooltip configuration is provided", () => {
describe("WHEN popover configuration is provided", () => {
it("SHOULD pass showPopoversWhenCollapsed and popoverPosition to context", () => {
render(
<Menu
Expand All @@ -57,7 +57,7 @@ describe("GIVEN <Menu />", () => {
expect(contextValue.popoverPosition).toBe("left");
});

it("SHOULD use default values when tooltip props are not provided", () => {
it("SHOULD use default values when popover props are not provided", () => {
render(
<Menu>
<ContextConsumer />
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Menu/src/menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const menuInsideFixedBar: Story = {
flex="0 1 auto"
width="20rem"
height="100vh"
borderColor="neutral-surfaceHighlight"
borderColor="neutral-interactive"
borderStyle="solid"
borderWidth="none"
borderRightWidth="1"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Menu/src/menu.utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const MenuStories = (props?: MenuProps) => (
{/* <Icon source={<TiendanubeIcon />} color="primary-interactive" /> */}

{props?.expanded ? (
<Icon source={<TiendanubeLogo />} color="primary-interactive" />
<Icon source={<TiendanubeLogo />} color="neutral-textHigh" />
) : (
<Icon source={<TiendanubeIcon />} color="primary-interactive" />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const MenuButtonAccordion = forwardRef(
children,
as,
expanded: expandedProp,
contentid,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Wire contentid to the trigger via aria-controls for complete accordion accessibility.

id={contentid} on the panel is good, but the trigger still lacks the explicit relationship to that panel. Add aria-controls on MenuButton so assistive tech can map control-to-content reliably.

♿ Proposed fix
         <MenuButton
           {...menuButton}
           onClick={
             controlledOpen !== undefined ? menuButton.onClick : handleOpen
           }
           active={active}
           aria-expanded={open && expanded}
+          aria-controls={open && expanded ? contentid : undefined}
           showPopoversWhenCollapsed={false}
           expanded={expanded}
         />

As per coding guidelines, "Implement proper ARIA attributes in React components" and "Follow WCAG 2.1 guidelines for accessibility compliance in React components".

Also applies to: 95-95

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/react/src/components/MenuButton/src/components/MenuButtonAccordion/MenuButtonAccordion.tsx`
at line 25, The MenuButton trigger is not wired to the panel via
aria-controls—add aria-controls={contentid} to the MenuButton/trigger element so
the trigger references the panel id (contentid) for correct ARIA mapping; locate
where MenuButton is rendered (the trigger element in MenuButtonAccordion /
component that receives contentid) and pass contentid into the trigger as
aria-controls, ensuring the panel retains id={contentid} and no other prop names
are changed.

...rest
}: MenuButtonAccordionBaseProps & { as: any },
ref
Expand Down Expand Up @@ -64,7 +65,7 @@ const MenuButtonAccordion = forwardRef(

const getBackgroundColor = () => {
if (active) {
return "primary-surface";
return "neutral-surface";
}
return open ? "neutral-surface" : "transparent";
};
Expand All @@ -91,7 +92,7 @@ const MenuButtonAccordion = forwardRef(
/>
{open && expanded && (
<Box
id="content-1"
id={contentid}
aria-hidden={!open}
height={open ? "auto" : "0"}
overflow="hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export interface MenuButtonAccordionProperties {
}

export type MenuButtonAccordionBaseProps = MenuButtonAccordionProperties & {
menuButton: Omit<MenuButtonProps, "expanded" | "tooltipText">;
menuButton: Omit<MenuButtonProps, "expanded" | "showPopoversWhenCollapsed">;
} & Omit<HTMLAttributes<HTMLElement>, "color">;
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const MenuButtonContent = forwardRef<
alignItems="center"
textDecoration="none"
backgroundColor={{
xs: active ? "primary-surface" : "transparent",
hover: "primary-surface",
active: "primary-surfaceHighlight",
xs: active ? "neutral-surface" : "transparent",
hover: "neutral-interactive",
active: "neutral-surface",
disabled: "neutral-surfaceDisabled",
}}
borderRadius="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ const ProductUpdatesFooter: React.FC<ProductUpdatesFooterProps> = ({
<Box {...rest}>
{renderDivider && (
<Box>
<Divider
appearance="primary"
marginLeft="-16px"
marginRight="-16px"
width="auto"
/>
<Divider />
</Box>
)}
<Box
Expand Down
95 changes: 20 additions & 75 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2728,20 +2728,6 @@ __metadata:
languageName: node
linkType: hard

"@floating-ui/react@npm:^0.26.0":
version: 0.26.0
resolution: "@floating-ui/react@npm:0.26.0"
dependencies:
"@floating-ui/react-dom": "npm:^2.0.2"
"@floating-ui/utils": "npm:^0.1.5"
tabbable: "npm:^6.0.1"
peerDependencies:
react: ">=16.8.0"
react-dom: ">=16.8.0"
checksum: f3a49868194ff3d097aec317491790fe0794028674b0bb6ce38113bb6934f21e8118cd7319a1f0ca0b2bbd74f2891f3412fbd66cd5f5115f3f9e0b620b3b6fa3
languageName: node
linkType: hard

"@floating-ui/react@npm:^0.26.1":
version: 0.26.1
resolution: "@floating-ui/react@npm:0.26.1"
Expand Down Expand Up @@ -3513,30 +3499,17 @@ __metadata:
languageName: unknown
linkType: soft

"@nimbus-ds/components@npm:5.56.1":
version: 5.56.1
resolution: "@nimbus-ds/components@npm:5.56.1"
"@nimbus-ds/components@npm:5.57.7-rc.2":
version: 5.57.7-rc.2
resolution: "@nimbus-ds/components@npm:5.57.7-rc.2"
dependencies:
"@floating-ui/react": ^0.27.5
"@nimbus-ds/icons": ^1.17.0
"@nimbus-ds/icons": ^1.21.0
react-indiana-drag-scroll: ^2.2.0
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0 || ^19.0
react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0
checksum: 971e15fc298609a2e0d6fc08f6bdb91db1d4dd2fda63afde15d4386d030e0257e2f8f3420875a5f43e59a528c728684015bc839500721b95b1f5e493c4d33052
languageName: node
linkType: hard

"@nimbus-ds/components@npm:^5":
version: 5.10.0
resolution: "@nimbus-ds/components@npm:5.10.0"
dependencies:
"@floating-ui/react": "npm:^0.26.0"
"@nimbus-ds/icons": "npm:^1.7.0"
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0
react-dom: ^16.8 || ^17.0 || ^18.0
checksum: b136c337fb07094b8fbfc89d72bab74f9169039c9a7722f133f4725944b032eabb15f1b1544255ae4d282809eda209b6c56a0ba66777cac629f1c87adb0c4c17
checksum: 46a7e2668c2fb6200c6c6e87a80f3325898282e4119d980f271d8e40eaa454cf1998b6d51ac97e7e8e6dfafb2e023a1d022836da38b5f5e2a8bd85d4ca789b3b
languageName: node
linkType: hard

Expand Down Expand Up @@ -3648,19 +3621,12 @@ __metadata:
languageName: node
linkType: hard

"@nimbus-ds/icons@npm:^1.17.0":
version: 1.17.0
resolution: "@nimbus-ds/icons@npm:1.17.0"
"@nimbus-ds/icons@npm:^1.21.0":
version: 1.21.0
resolution: "@nimbus-ds/icons@npm:1.21.0"
peerDependencies:
react: ^16.8 || ^17.0 || ^18.0 || ^19.0
checksum: d9b5d7a95c81815cf85a92a6c4803573b6aef045a585d7177581358de7265feed30fc0f66d89c5895b5a427161c746af0c433d467691a69443b46ca2d7c10220
languageName: node
linkType: hard

"@nimbus-ds/icons@npm:^1.7.0":
version: 1.7.0
resolution: "@nimbus-ds/icons@npm:1.7.0"
checksum: 64646f6988874855729b88270192783e236ed3150fd4ff840b86e5f56de2eada444c3236223d1cc825333ebdb04957cd21410af2d656353be1cfad8bcc593ae2
checksum: f1c00fb1164d7b5cc440ebed3c79416afbdaa4844ea865e9b34eb059630028e1f6494467dd280dbfb69d9b33b1dfbe06a3c1c4b99cb1badc9e3c61e513f5d36e
languageName: node
linkType: hard

Expand Down Expand Up @@ -3874,17 +3840,10 @@ __metadata:
languageName: unknown
linkType: soft

"@nimbus-ds/styles@npm:9.61.1":
version: 9.61.1
resolution: "@nimbus-ds/styles@npm:9.61.1"
checksum: 2a003aff355a2107a7b6e03250a7140ec76f69fe8d3362fc1c558b6bfb7732e082b5679d9531004f03a2ec7b2c148034999054baa2cc9fc4237aa3746c388aed
languageName: node
linkType: hard

"@nimbus-ds/styles@npm:^9.11.0":
version: 9.11.0
resolution: "@nimbus-ds/styles@npm:9.11.0"
checksum: 4ebce6f620277c8f555920b4fca53bfdca02eebf09457f90f9ae47254f51e36a75e29d83b992b934fa47a2acedf592fdb4055b9317b154bca3a95e06a8c8f7d2
"@nimbus-ds/styles@npm:9.62.7-rc.2":
version: 9.62.7-rc.2
resolution: "@nimbus-ds/styles@npm:9.62.7-rc.2"
checksum: 85d4cf47ce4f28efdfd7f9e08cb561116ea5b8dec2597b0ff05e39b83340b9635d3175c0ed91ed52a2efda30d5e3cbb869e9ff039bfd0aaf0ab8eb0a5dacc7db
languageName: node
linkType: hard

Expand All @@ -3911,24 +3870,10 @@ __metadata:
languageName: unknown
linkType: soft

"@nimbus-ds/tokens@npm:^9.0.0":
version: 9.0.0
resolution: "@nimbus-ds/tokens@npm:9.0.0"
checksum: be832f91c7ab225a47db0c34535c85b75ae53d825e94c5ed82ab0780724256e72ca7eb26c92df23fd1cf48cb8cbfc4f498e0a67c45b0a9176214aa5d5ea23fa0
languageName: node
linkType: hard

"@nimbus-ds/tokens@npm:^9.1.0":
version: 9.1.0
resolution: "@nimbus-ds/tokens@npm:9.1.0"
checksum: 42e4ad8c73588b93754a2a0bb6868b1c43fb306b4ccfb493e26237a7425bbfec3d4682fe922f760822fa49b5adf0ae996fcbd32ea7983803317be1e5acba9829
languageName: node
linkType: hard

"@nimbus-ds/tokens@npm:^9.5.0":
version: 9.5.0
resolution: "@nimbus-ds/tokens@npm:9.5.0"
checksum: 22605538f3abf5eac52d648aebfa18a75b95b4d853cbe14761d8aaff4aca8ed0e94c0de70e50565fd061be40f25544148cfb2e5f0fa5fcf95b46d3d35051b236
"@nimbus-ds/tokens@npm:9.5.3-rc.5":
version: 9.5.3-rc.5
resolution: "@nimbus-ds/tokens@npm:9.5.3-rc.5"
checksum: 0160364e48c8dbc5880e67074389cb3fbcf4f1f320c65cc349eb34ae482ede9c56f55a75efdd01dd6025449f3161ee2b9c53e5d9612336719ba8a105fb4e48f4
languageName: node
linkType: hard

Expand Down Expand Up @@ -12442,11 +12387,11 @@ __metadata:
"@commitlint/config-conventional": ^17.2.0
"@jest/types": ^29.2.1
"@mdx-js/react": ^3.0.0
"@nimbus-ds/components": 5.56.1
"@nimbus-ds/components": 5.57.7-rc.2
"@nimbus-ds/icons": ^1.15.1
"@nimbus-ds/scripts": ^1.8.2
"@nimbus-ds/styles": 9.61.1
"@nimbus-ds/tokens": ^9.5.0
"@nimbus-ds/styles": 9.62.7-rc.2
"@nimbus-ds/tokens": 9.5.3-rc.5
"@storybook/addon-docs": ^8.6.14
"@storybook/addon-essentials": ^8.6.14
"@storybook/addon-interactions": ^8.6.14
Expand Down
Loading