Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions components/src/OptionsEditorLayout/OptionsEditorControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import type { FormControlLabelProps } from '@mui/material';
import { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';
import InformationOutlineIcon from 'mdi-material-ui/InformationOutline';
import type { ReactElement } from 'react';
import React from 'react';
import React, { useId } from 'react';

import { InfoTooltip } from '../InfoTooltip';
import { useId } from '../utils';

export type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {
description?: string;
Expand All @@ -27,7 +26,7 @@ export type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'c
export const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {
// Make sure we have a unique ID we can use for associating labels and
// controls for a11y.
const generatedControlId = useId('EditorSectionControl');
const generatedControlId = `EditorSectionControl-${useId()}`;
const controlId = `${generatedControlId}-control`;
const labelId = `${generatedControlId}-label`;

Expand Down
27 changes: 0 additions & 27 deletions components/src/utils/component-ids.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions components/src/utils/component-ids.ts

This file was deleted.

1 change: 0 additions & 1 deletion components/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export * from './axis';
export * from './browser-storage';
export * from './chart-actions';
export * from './combine-sx';
export * from './component-ids';
export * from './data-field-interpolation';
export * from './format';
export * from './request-interpolation';
Expand Down
13 changes: 3 additions & 10 deletions dashboards/src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@

import type { CardProps } from '@mui/material';
import { Card, CardContent } from '@mui/material';
import {
ErrorAlert,
ErrorBoundary,
ItemActionsProvider,
SelectionProvider,
combineSx,
useId,
} from '@perses-dev/components';
import { ErrorAlert, ErrorBoundary, ItemActionsProvider, SelectionProvider, combineSx } from '@perses-dev/components';
import type { ActionOptions } from '@perses-dev/plugin-system';
import { useDataQueriesContext, usePluginRegistry } from '@perses-dev/plugin-system';
import type { PanelDefinition } from '@perses-dev/spec';
import type { ComponentType, ReactNode } from 'react';
import { memo, useEffect, useMemo, useState } from 'react';
import { memo, useEffect, useId, useMemo, useState } from 'react';
import useResizeObserver from 'use-resize-observer';

import type { PanelGroupItemId } from '../../model';
Expand Down Expand Up @@ -96,7 +89,7 @@ export const Panel = memo(function Panel(props: PanelProps) {
} = props;

// Make sure we have an ID we can use for aria attributes
const generatedPanelId = useId('Panel');
const generatedPanelId = `Panel-${useId()}`;
const headerId = `${generatedPanelId}-header`;

const [contentElement, setContentElement] = useState<HTMLElement | null>(null);
Expand Down
Loading