From 57283d607d9ab425ce5f0aa937d20cf6ed20e0ac Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Tue, 2 Apr 2024 10:33:06 -0500 Subject: [PATCH] Rename / move PickerItemContent (#1909) --- .../{picker/PickerItemContent.tsx => ItemContent.tsx} | 10 +++++----- packages/components/src/spectrum/index.ts | 1 + packages/components/src/spectrum/picker/Picker.tsx | 4 ++-- packages/components/src/spectrum/picker/index.ts | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) rename packages/components/src/spectrum/{picker/PickerItemContent.tsx => ItemContent.tsx} (88%) diff --git a/packages/components/src/spectrum/picker/PickerItemContent.tsx b/packages/components/src/spectrum/ItemContent.tsx similarity index 88% rename from packages/components/src/spectrum/picker/PickerItemContent.tsx rename to packages/components/src/spectrum/ItemContent.tsx index d680c56ed2..7f4af2059d 100644 --- a/packages/components/src/spectrum/picker/PickerItemContent.tsx +++ b/packages/components/src/spectrum/ItemContent.tsx @@ -2,9 +2,9 @@ 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; } @@ -12,9 +12,9 @@ export interface PickerItemContentProps { * 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; } @@ -57,4 +57,4 @@ export function PickerItemContent({ ); } -export default PickerItemContent; +export default ItemContent; diff --git a/packages/components/src/spectrum/index.ts b/packages/components/src/spectrum/index.ts index e001ef8beb..bdb4f7a506 100644 --- a/packages/components/src/spectrum/index.ts +++ b/packages/components/src/spectrum/index.ts @@ -24,4 +24,5 @@ export * from './View'; /** * Custom DH spectrum utils */ +export * from './ItemContent'; export * from './utils'; diff --git a/packages/components/src/spectrum/picker/Picker.tsx b/packages/components/src/spectrum/picker/Picker.tsx index e706ede9d8..8d533480a5 100644 --- a/packages/components/src/spectrum/picker/Picker.tsx +++ b/packages/components/src/spectrum/picker/Picker.tsx @@ -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'; @@ -143,7 +143,7 @@ export function Picker({ textValue={textValue === '' ? 'Empty' : textValue} > <> - {content} + {content} {tooltipOptions == null || content === '' ? null : ( {createTooltipContent(content)} diff --git a/packages/components/src/spectrum/picker/index.ts b/packages/components/src/spectrum/picker/index.ts index b666d3021b..c434d5d810 100644 --- a/packages/components/src/spectrum/picker/index.ts +++ b/packages/components/src/spectrum/picker/index.ts @@ -1,2 +1 @@ export * from './Picker'; -export * from './PickerItemContent';