From 95446577eade5326336a0148e8f893e37521106f Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 11 Jul 2024 16:21:41 -0700 Subject: [PATCH] Add aliases for compressed combo-box Signed-off-by: Miki --- src/components/combo_box/combo_box.tsx | 12 ++++++++++++ src/components/combo_box/index.ts | 8 +++++++- src/components/index.js | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/combo_box/combo_box.tsx b/src/components/combo_box/combo_box.tsx index fa1de7d014..19d5fedb6a 100644 --- a/src/components/combo_box/combo_box.tsx +++ b/src/components/combo_box/combo_box.tsx @@ -1106,3 +1106,15 @@ export class OuiComboBox extends Component< ); } } + +export type OuiCompressedComboBoxProps = Omit< + OuiComboBoxProps, + 'compressed' +>; + +export class OuiCompressedComboBox extends OuiComboBox { + static defaultProps = { + ...OuiComboBox.defaultProps, + compressed: true, + }; +} diff --git a/src/components/combo_box/index.ts b/src/components/combo_box/index.ts index 917db439e9..fd96c097a8 100644 --- a/src/components/combo_box/index.ts +++ b/src/components/combo_box/index.ts @@ -28,7 +28,13 @@ * under the License. */ -export { OuiComboBox, OuiComboBoxProps } from './combo_box'; +export { + OuiComboBox, + OuiComboBoxProps, + OuiCompressedComboBox, + OuiCompressedComboBoxProps, +} from './combo_box'; + export * from './combo_box_input'; export * from './combo_box_options_list'; export { diff --git a/src/components/index.js b/src/components/index.js index 81fc49d0ca..fdc895af1d 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -61,7 +61,7 @@ export { OuiCompressedColorPickerProps, } from './color_picker'; -export { OuiComboBox } from './combo_box'; +export { OuiComboBox, OuiCompressedComboBox } from './combo_box'; export { OuiComment, OuiCommentList } from './comment_list';