Skip to content

Commit

Permalink
add ToggleButton wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Sep 13, 2024
1 parent 5c3a378 commit 4112b2b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions plugins/ui/src/js/src/elements/ToggleButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import {
ToggleButton as DHCToggleButton,
ToggleButtonProps as DHCToggleButtonProps,
} from '@deephaven/components';
import { useButtonProps } from './hooks/useButtonProps';
import { SerializedButtonEventProps } from './model/SerializedPropTypes';

export function ToggleButton(
props: SerializedButtonEventProps<DHCToggleButtonProps>
): JSX.Element {
const buttonProps = useButtonProps(props);

// eslint-disable-next-line react/jsx-props-no-spreading
return <DHCToggleButton {...buttonProps} />;
}

export default ToggleButton;
1 change: 1 addition & 0 deletions plugins/ui/src/js/src/elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ export * from './Tabs';
export * from './TabPanels';
export * from './TextField';
export * from './TextArea';
export * from './ToggleButton';
export * from './UITable/UITable';
export * from './utils';
3 changes: 1 addition & 2 deletions plugins/ui/src/js/src/widget/WidgetUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
Switch,
TabList,
Text,
ToggleButton,
View,
} from '@deephaven/components';
import { ValueOf } from '@deephaven/utils';
Expand Down Expand Up @@ -66,6 +65,7 @@ import {
TabPanels,
TextField,
TextArea,
ToggleButton,
UITable,
Tabs,
} from '../elements';
Expand All @@ -78,7 +78,6 @@ const shouldWrapTextChildren = new Set<string>([
ELEMENT_NAME.flex,
ELEMENT_NAME.grid,
ELEMENT_NAME.view,
ELEMENT_NAME.toggleButton,
]);

const log = Log.module('@deephaven/js-plugin-ui/WidgetUtils');
Expand Down

0 comments on commit 4112b2b

Please sign in to comment.