Skip to content

Commit

Permalink
Rename / move PickerItemContent (deephaven#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 2, 2024
1 parent d6a0aa7 commit 57283d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import { Children, cloneElement, isValidElement, ReactNode } from 'react';
import { Text } from '@adobe/react-spectrum';
import cl from 'classnames';
import { isElementOfType } from '@deephaven/react-hooks';
import stylesCommon from '../../SpectrumComponent.module.scss';
import stylesCommon from '../SpectrumComponent.module.scss';

export interface PickerItemContentProps {
export interface ItemContentProps {
children: ReactNode;
}

/**
* Picker item content. Text content will be wrapped in a Spectrum Text
* component with ellipsis overflow handling.
*/
export function PickerItemContent({
export function ItemContent({
children: content,
}: PickerItemContentProps): JSX.Element | null {
}: ItemContentProps): JSX.Element | null {
if (isValidElement(content)) {
return content;
}
Expand Down Expand Up @@ -57,4 +57,4 @@ export function PickerItemContent({
);
}

export default PickerItemContent;
export default ItemContent;
1 change: 1 addition & 0 deletions packages/components/src/spectrum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export * from './View';
/**
* Custom DH spectrum utils
*/
export * from './ItemContent';
export * from './utils';
4 changes: 2 additions & 2 deletions packages/components/src/spectrum/picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
ItemKey,
getItemKey,
} from '../utils/itemUtils';
import { PickerItemContent } from './PickerItemContent';
import { ItemContent } from '../ItemContent';
import { Item, Section } from '../shared';
import { Text } from '../Text';

Expand Down Expand Up @@ -143,7 +143,7 @@ export function Picker({
textValue={textValue === '' ? 'Empty' : textValue}
>
<>
<PickerItemContent>{content}</PickerItemContent>
<ItemContent>{content}</ItemContent>
{tooltipOptions == null || content === '' ? null : (
<Tooltip options={tooltipOptions}>
{createTooltipContent(content)}
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/spectrum/picker/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './Picker';
export * from './PickerItemContent';

0 comments on commit 57283d6

Please sign in to comment.