Skip to content

Commit

Permalink
Merge branch 'release-2024-12-10' into 'master'
Browse files Browse the repository at this point in the history
Release 2024-12-10

See merge request ux/pingux!3093
  • Loading branch information
Pallavi N committed Dec 10, 2024
2 parents 6dccbcd + 081bb26 commit e4f01ec
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pingux/astro",
"version": "2.96.0",
"version": "2.97.0-alpha.1",
"description": "React component library for Ping Identity's design system",
"repository": {
"type": "git",
Expand Down
14 changes: 14 additions & 0 deletions src/components/SelectField/SelectField.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,17 @@ export const WithoutStatusIndicator = () => (
<Item key="yellow">Yellow</Item>
</SelectField>
);

export const WithHelpHint = () => (
<OverlayProvider>
<SelectField
width="100%"
hintText="Example Hint"
label="What's your favorite color?"
>
<Item key="red">Red</Item>
<Item key="blue">Blue</Item>
<Item key="yellow">Yellow</Item>
</SelectField>
</OverlayProvider>
);
11 changes: 10 additions & 1 deletion src/components/SelectField/SelectField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';

import { Item, Section, SelectField } from '../../index';
import statuses from '../../utils/devUtils/constants/statuses';
import { render, screen } from '../../utils/testUtils/testWrapper';
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';

import { SelectItemProps, SelectSectionProps } from './SelectField.stories';
Expand Down Expand Up @@ -149,3 +149,12 @@ test('renders default placeholder text', () => {
const placeholder = screen.getByText(placeholderText);
expect(placeholder).toBeInTheDocument();
});

test('should show hintText text if prop is passed', () => {
const hintText = 'some hint text';
getComponent({ hintText });
const helpHintButton = screen.getByTestId('help-hint__button');
fireEvent.mouseMove(helpHintButton);
fireEvent.mouseEnter(helpHintButton);
expect(screen.getByText(hintText)).toBeInTheDocument();
});
9 changes: 8 additions & 1 deletion src/components/TooltipTrigger/Tooltip.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ export const container = {
overflow: 'visible',
wordBreak: 'break-word',
display: 'flex',

'.is-right > * > &, .is-left > * > &': {
maxWidth: '24em',
maxHeight: '6.5em',
WebkitLineClamp: '4',
},
};

export const badgeTooltipContainer = {
...container,
fontSize: 'sm',
fontWeight: '1',
lineHeight: '15.87px',
};

const badge = {
...baseBadge,
cursor: 'default',
Expand Down Expand Up @@ -47,6 +53,7 @@ const inline = {

export default {
container,
badgeTooltipContainer,
badge,
button,
inline,
Expand Down
10 changes: 9 additions & 1 deletion src/components/TooltipTrigger/TooltipTrigger.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Meta, StoryFn } from '@storybook/react';
import DocsLayout from '../../../.storybook/storybookDocsLayout';
import { Box, Button, Icon, IconButton, Text, Tooltip, TooltipTrigger } from '../../index';
import { TooltipTriggerProps } from '../../types/tooltipTrigger';
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';

import TooltipTriggerReadme from './TooltipTrigger.mdx';

Expand Down Expand Up @@ -111,11 +112,18 @@ export const BadgeWithTooltip: StoryFn = () => (
Some text
</Text>
</Button>
<Tooltip>Useful tooltip</Tooltip>
<Tooltip variant="variants.tooltip.badgeTooltipContainer">Useful tooltip</Tooltip>
</TooltipTrigger>
</Box>
);

BadgeWithTooltip.parameters = {
design: {
type: 'figma',
url: FIGMA_LINKS.tooltipTrigger.badgeWithTooltip,
},
};

export const TextWithTooltip: StoryFn = () => (
<Box pl={50}>
<TooltipTrigger>
Expand Down
1 change: 1 addition & 0 deletions src/types/selectField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface SelectFieldProps<T> extends Omit<StyleProps, 'direction'>, UseS
inContainer?: React.ReactNode,
}
'data-testid'?: string;
hintText?: string;
}

export interface SelectFieldBaseProps extends UseSelectFieldReturnProps<object>,
Expand Down
3 changes: 3 additions & 0 deletions src/utils/designUtils/figmaLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export const FIGMA_LINKS = {
withoutButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16196&t=OK8Fy4P3se6BKy0F-4',
withoutLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=52102-16201&t=OK8Fy4P3se6BKy0F-4',
},
tooltipTrigger: {
badgeWithTooltip: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=59201-5404&t=wsQsGpX0SmOiAweL-4',
},
editButton: {
default: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=58623-6267&t=pXTSE3YlGbL0X49N-4',
},
Expand Down

0 comments on commit e4f01ec

Please sign in to comment.