Skip to content

Commit 040237b

Browse files
feat(manager-react-components): bump ods version 18.3.0 (#14080)
Udpate ods version to 18.3.0 Move ods to peerDependencies Update ODS version in Generator Pre-build documentation ref: MANAGER-14622 Signed-off-by: Alex Boungnaseng <[email protected]>
1 parent ae9859f commit 040237b

File tree

18 files changed

+115
-54
lines changed

18 files changed

+115
-54
lines changed

docs/.vitepress/.nojekyll

Whitespace-only changes.

docs/cli/prebuild.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const pick = require('lodash/pick');
55

66
// Get all workspaces defined in the `package.json` file.
7-
const { workspaces } = require('./../../package.json');
7+
const { workspaces } = require('../../package.json');
88

99
// Keep the bare minimum entries from all package.json files.
1010
const entries = ['name', 'version', 'description', 'repository'];
@@ -19,7 +19,7 @@ const packages = getMonorepoPackages(directoryPath).map(
1919
);
2020

2121
// Group packages by their corresponding workspaces.
22-
const groupedWorkspaces = workspaces.map((workspace) => {
22+
const groupedWorkspaces = workspaces.packages.map((workspace) => {
2323
const packagesList = packages.filter((pkg) => {
2424
// Remove the pattern `/*` from the workspace name.
2525
if (

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"docs:build": "yarn docs:build:manager-react-components && node cli/prebuild.js && vitepress build --base /manager/",
88
"docs:build:manager-react-components": "cd ../packages/manager-react-components && yarn build:storybook && rm -rf ../../docs/docs/public/storybook-static && mkdir -p ../../docs/docs/public/storybook-static && cp -r ./storybook-static/* ../../docs/docs/public/storybook-static",
9-
"docs:deploy": "yarn run docs:build && gh-pages -d .vitepress/dist -m \"docs: update documentation [skip ci]\"",
9+
"docs:deploy": "yarn run docs:build && touch .vitepress/dist/storybook-static/.nojekyll && touch .vitepress/dist/.nojekyll && gh-pages -d .vitepress/dist --dotfiles -m \"docs: update documentation [skip ci]\"",
1010
"docs:dev": "node cli/prebuild.js && vitepress dev",
1111
"docs:preview": "vitepress preview"
1212
},

packages/manager-react-components/.storybook/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StorybookConfig } from '@storybook/react-vite';
2+
23
const config: StorybookConfig = {
34
stories: [
45
'../src/**/*.stories.@(js|jsx|ts|tsx|mdx)',
@@ -10,7 +11,7 @@ const config: StorybookConfig = {
1011
'@storybook/addon-essentials',
1112
'@storybook/addon-interactions',
1213
'@storybook/addon-styling',
13-
'@storybook/addon-doc',
14+
'@storybook/addon-docs',
1415
],
1516
framework: {
1617
name: '@storybook/react-vite',

packages/manager-react-components/.storybook/ovh.theme.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export default create({
44
base: 'light',
55

66
// Brand
7-
colorPrimary: '#004FD6',
8-
colorSecondary: '#004FD6',
7+
// colorPrimary: '#004FD6',
8+
// colorSecondary: '#004FD6',
99

1010
// UI
11-
appBg: '#FF3358',
11+
// appBg: '#FF3358',
1212
appBorderColor: '#004FD6',
1313
appBorderRadius: 0,
1414
appContentBg: '#ffffff',
@@ -23,9 +23,9 @@ export default create({
2323
textInverseColor: 'rgba(255,255,255,0.9)',
2424

2525
// Toolbar default and active colors
26-
barBg: '#f3fcff',
27-
barSelectedColor: '#004FD6',
28-
barTextColor: '#202124',
26+
// barBg: '#f3fcff',
27+
// barSelectedColor: '#004FD6',
28+
// barTextColor: '#202124',
2929

3030
// Form colors
3131
inputBg: '#ffffff',

packages/manager-react-components/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ovh-ux/manager-react-components",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"license": "BSD-3-Clause",
55
"author": "OVH SAS",
66
"types": "dist/types/src/lib.d.ts",
@@ -36,8 +36,6 @@
3636
},
3737
"dependencies": {
3838
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
39-
"@ovhcloud/ods-components": "18.0.0",
40-
"@ovhcloud/ods-themes": "18.0.0",
4139
"@tanstack/react-query": "^5.51.21",
4240
"@tanstack/react-table": "^8.20.1",
4341
"clsx": "^2.1.1",
@@ -52,11 +50,12 @@
5250
"devDependencies": {
5351
"@babel/core": "7.22.10",
5452
"@mdx-js/react": "^3.0.1",
53+
"@ovhcloud/ods-components": "^18.3.0",
54+
"@ovhcloud/ods-themes": "^18.3.0",
5555
"@ovh-ux/manager-core-api": "^0.9.0",
5656
"@ovh-ux/manager-react-shell-client": "^0.8.1",
5757
"@ovh-ux/manager-tailwind-config": "^0.2.0",
5858
"@ovh-ux/manager-vite-config": "^0.8.1",
59-
"@storybook/addon-a11y": "8.0.4",
6059
"@storybook/addon-docs": "^7.5.3",
6160
"@storybook/addon-essentials": "7.5.3",
6261
"@storybook/addon-interactions": "7.5.3",
@@ -115,6 +114,8 @@
115114
"zustand": "^4.5.5"
116115
},
117116
"peerDependencies": {
117+
"@ovhcloud/ods-components": "^18.3.0",
118+
"@ovhcloud/ods-themes": "^18.3.0",
118119
"@ovh-ux/manager-core-api": "^0.9.0-alpha.0",
119120
"@ovh-ux/manager-react-shell-client": "^0.8.0-alpha.3",
120121
"i18next": "^23.8.2",

packages/manager-react-components/src/components/ManagerButton/ManagerButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export const ManagerButton = ({
4444
<>
4545
<div id={id} className="w-fit">
4646
<OdsButton
47-
{...restProps}
4847
data-testid="manager-button-tooltip"
48+
{...restProps}
4949
isDisabled={true}
5050
label={label}
5151
onClick={null}
@@ -57,8 +57,8 @@ export const ManagerButton = ({
5757
</>
5858
) : (
5959
<OdsButton
60-
{...restProps}
6160
data-testid="manager-button-without-tooltip"
61+
{...restProps}
6262
isDisabled={true}
6363
onClick={null}
6464
label={label}

packages/manager-react-components/src/components/content/dashboard-tile/dashboard-tile.component.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { OdsDivider, OdsCard } from '@ovhcloud/ods-components/react';
3+
import { ODS_CARD_COLOR } from '@ovhcloud/ods-components';
34
import { TileBlock } from './tile-block.component';
45

56
export type DashboardTileBlockItem = {
@@ -11,13 +12,19 @@ export type DashboardTileBlockItem = {
1112
export type DashboardTileProps = {
1213
title?: string;
1314
items: DashboardTileBlockItem[];
15+
'data-testid'?: string;
1416
};
1517

1618
export const DashboardTile: React.FC<DashboardTileProps> = ({
1719
title,
1820
items,
21+
...props
1922
}) => (
20-
<OdsCard className="w-full flex-col p-[1rem]" color="neutral">
23+
<OdsCard
24+
data-testid={props['data-testid']}
25+
className="w-full flex-col p-[1rem]"
26+
color={ODS_CARD_COLOR.neutral}
27+
>
2128
<div className="flex flex-col w-full">
2229
{title && (
2330
<>

packages/manager-react-components/src/components/content/headers/headers.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const guideItems = [
4646
const HeadingWithActionButton: HeadersProps = {
4747
title: 'Example for header with actions ',
4848
description: 'description for header',
49-
headerButton: <ActionMenu items={actionItems} />,
49+
headerButton: <ActionMenu id="1" items={actionItems} />,
5050
};
5151
const HeadingWithGuideButton: HeadersProps = {
5252
title: 'Example for header with guides',

packages/manager-react-components/src/components/navigation/menus/action/action.component.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ export interface ActionMenuItem {
1414
id: number;
1515
rel?: string;
1616
download?: string;
17-
href?: string;
1817
target?: string;
1918
onClick?: () => void;
2019
label: string;
2120
variant?: ODS_BUTTON_VARIANT;
22-
disabled?: boolean;
2321
iamActions?: string[];
2422
urn?: string;
23+
className?: string;
2524
}
2625

2726
export interface ActionMenuProps {
2827
items: ActionMenuItem[];
2928
isCompact?: boolean;
3029
icon?: ODS_ICON_NAME;
3130
variant?: ODS_BUTTON_VARIANT;
32-
disabled?: boolean;
31+
id: string;
32+
isDisabled?: boolean;
3333
}
3434

3535
const MenuItem = ({
@@ -45,16 +45,13 @@ const MenuItem = ({
4545
size: ODS_BUTTON_SIZE.sm,
4646
variant: ODS_BUTTON_VARIANT.ghost,
4747
displayTooltip: false,
48+
className: 'w-full action-menu-item',
4849
...item,
4950
};
5051
return (
5152
<div className="-mx-[2px]">
5253
{!item?.iamActions || item?.iamActions?.length === 0 ? (
53-
<OdsButton
54-
{...buttonProps}
55-
isDisabled={buttonProps.disabled}
56-
label={item.label}
57-
>
54+
<OdsButton {...buttonProps} label={item.label}>
5855
<span slot="start">
5956
<span>{item.label}</span>
6057
</span>
@@ -66,7 +63,6 @@ const MenuItem = ({
6663
iamActions={item.iamActions}
6764
urn={item.urn}
6865
{...buttonProps}
69-
isDisabled={buttonProps.disabled || undefined}
7066
>
7167
<span slot="start">
7268
<span>{item.label}</span>
@@ -82,19 +78,22 @@ export const ActionMenu: React.FC<ActionMenuProps> = ({
8278
isCompact,
8379
icon,
8480
variant = ODS_BUTTON_VARIANT.outline,
85-
disabled,
81+
isDisabled = false,
82+
id,
8683
}) => {
8784
const { t } = useTranslation('buttons');
8885
const [isTrigger, setIsTrigger] = React.useState(false);
8986

9087
return (
9188
<>
92-
<div id="navigation-action-trigger">
89+
<div key={id} id={`navigation-action-trigger-${id}`}>
9390
<OdsButton
9491
data-testid="navigation-action-trigger-action"
92+
className="action-menu-btn"
9593
slot="menu-title"
94+
id={id}
9695
variant={variant}
97-
isDisabled={disabled}
96+
isDisabled={isDisabled}
9897
size={ODS_BUTTON_SIZE.sm}
9998
onClick={() => setIsTrigger(true)}
10099
{...(!isCompact && { label: t('common_actions') })}
@@ -107,12 +106,17 @@ export const ActionMenu: React.FC<ActionMenuProps> = ({
107106
</div>
108107
<OdsPopover
109108
className="py-[8px] px-0 overflow-hidden"
110-
triggerId="navigation-action-trigger"
109+
triggerId={`navigation-action-trigger-${id}`}
111110
with-arrow
112111
>
113-
{items.map(({ id, ...item }) => {
112+
{items.map(({ id: itemId, ...item }) => {
114113
return (
115-
<MenuItem id={id} key={id} item={item} isTrigger={isTrigger} />
114+
<MenuItem
115+
id={itemId}
116+
key={itemId}
117+
item={item}
118+
isTrigger={isTrigger}
119+
/>
116120
);
117121
})}
118122
</OdsPopover>

0 commit comments

Comments
 (0)