Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mrc): fix <TileBlock /> #14924

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
DashboardTileBlockItem,
} from './dashboard-tile.component';
import ActionMenu from '../../navigation/menus/action/action.component';
import { Clipboard } from '../../clipboard/clipboard.component';

const actionItems = [
{
Expand Down Expand Up @@ -36,13 +37,24 @@ const items: DashboardTileBlockItem[] = [
label: 'Text Directly',
value: 'Text example',
},
{
id: 'clipboard',
label: 'Clipboard',
value: <Clipboard className="block" value="example value" />,
},
{
id: 'long-text',
label: 'Long Text',
value:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
},
{
id: 'menu-example',
label: 'Menu Example',
value: (
<div className="flex">
<div className="mr-auto">Test value</div>
<ActionMenu isCompact items={actionItems} />
<ActionMenu isCompact items={actionItems} id={'action-menu-story'} />
</div>
),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import { ODS_TEXT_PRESET } from '@ovhcloud/ods-components';
import { OdsText } from '@ovhcloud/ods-components/react';

export type TileBlockProps = React.PropsWithChildren<{
label?: string;
Expand All @@ -8,12 +10,8 @@ export const TileBlock: React.FC<React.PropsWithChildren<TileBlockProps>> = ({
label,
children,
}) => (
<dl className="flex flex-col gap-y-[8px] my-0">
<dt className="tile-block-title m-0 text-[--ods-color-heading] text-[16px] leading-[16px] font-semibold">
{label}
</dt>
<dd className="tile-block-description m-0 text-[--ods-color-text] text-[16px] leading-[16px] min-h-[16px]">
{children}
</dd>
</dl>
<div className="flex flex-col gap-1">
<OdsText preset={ODS_TEXT_PRESET.heading6}>{label}</OdsText>
{children}
</div>
Comment on lines +13 to +16
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Retaining the dl dt dd format is good imo as it provides the necessary accessibility https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl and in fact it's ties the label to the information.

);
Loading