Skip to content

Commit

Permalink
Export spectrum useProvider (deephaven#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 18, 2024
1 parent 383b98c commit fb8e4a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/components/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './ThemeUtils';
export * from './useTheme';
export * from './Logo';
export * from './colorUtils';
export * from './useSpectrumThemeProvider';
5 changes: 5 additions & 0 deletions packages/components/src/theme/useSpectrumThemeProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { useProvider } from '@adobe/react-spectrum';

export const useSpectrumThemeProvider = useProvider;

export default useSpectrumThemeProvider;
4 changes: 2 additions & 2 deletions packages/jsapi-components/src/spectrum/ListView.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useProvider } from '@adobe/react-spectrum';
import {
ListView as ListViewBase,
ListViewProps as ListViewPropsBase,
NormalizedItemData,
useSpectrumThemeProvider,
} from '@deephaven/components';
import { dh as DhType } from '@deephaven/jsapi-types';
import { Settings } from '@deephaven/jsapi-utils';
Expand Down Expand Up @@ -30,7 +30,7 @@ export function ListView({
settings,
...props
}: ListViewProps): JSX.Element {
const { scale } = useProvider();
const { scale } = useSpectrumThemeProvider();
const itemHeight = LIST_VIEW_ROW_HEIGHTS[props.density ?? 'regular'][scale];

const { getFormattedString: formatValue } = useFormatter(settings);
Expand Down

0 comments on commit fb8e4a1

Please sign in to comment.