Skip to content

Commit

Permalink
fix(FloatingHelper): fixed removed props.
Browse files Browse the repository at this point in the history
  • Loading branch information
soslayando committed Jan 15, 2024
1 parent 7c6b798 commit 72fd1e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import * as Stories from './FloatingHelper.stories';
## Overview

Component that provides a floating message to assist the user with a particular task or input.
Usually is used to provide helping info to the user when is filling a form, and we want to save
screen space avoiding use docked helpers in the fields.

## How to import

<Source
code={`
import { FloatingHelper } from '@devoinc/genesys-ui';
`}
/>
<Source code={`import { FloatingHelper } from '@devoinc/genesys-ui';`} />

## Basic usage

Expand Down
13 changes: 2 additions & 11 deletions packages/core/src/components/FloatingHelper/FloatingHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,22 @@ import { Typography, InlineMessage, HelperProps } from '..';
import { HELPER_ICON_BUTTON_SIZE_MAP } from '../Helper/constants';
import { hasStatus } from '../../utils/validations';

export interface FloatingHelperProps extends HelperProps {
visible?: boolean;
setVisible?: (isVisible: boolean) => void;
}

export const FloatingHelper: React.FC<FloatingHelperProps> = ({
export const FloatingHelper: React.FC<HelperProps> = ({
id,
visible = false,
message,
size = 'md',
setVisible,
status = 'base',
tooltip,
}) => {
return (
<InlineMessage
id={id}
setVisible={setVisible}
trigger={{ size: HELPER_ICON_BUTTON_SIZE_MAP[size] }}
status={hasStatus(status) ? status : 'help'}
tooltip={tooltip}
visible={visible}
>
<InlineMessage.Panel>
<Typography.Paragraph>{message}</Typography.Paragraph>
<Typography.Paragraph gutterBottom="0">{message}</Typography.Paragraph>
</InlineMessage.Panel>
</InlineMessage>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const InlineMessagePanel: React.FC<InlineMessagePanelProps> = ({
<Panel.Body
hasScroll={hasScroll}
panelBodyRef={targetElRef}
size="sm"
styles={inlineMessagePanelBodyMixin({ hasScroll, theme })}
>
{children}
Expand Down

0 comments on commit 72fd1e3

Please sign in to comment.