From f9c6f1b601ac9a5aafba6b3e6b7783ac3265cb5c Mon Sep 17 00:00:00 2001 From: Yash raj chhabra <95337653+ychhabra-eightfold@users.noreply.github.com> Date: Thu, 5 May 2022 17:02:10 +0530 Subject: [PATCH] feat: abstract out common component props as oc base props, add ability to forward ref (#106) * feat: extract out common component props as oc base props * feat: extend HTMLAttributes * feat: use OcBaseProps in button * feat: use base prop in all components * chore: update snapshots --- src/__snapshots__/storybook.test.js.snap | 21 +++ src/components/Badge/Badge.tsx | 3 +- src/components/Badge/Badge.types.tsx | 11 +- src/components/Button/Button.types.ts | 3 +- .../Button/PrimaryButton/PrimaryButton.tsx | 2 + .../SecondaryButton/SecondaryButton.tsx | 2 + .../Dialog/BaseDialog/BaseDialog.tsx | 154 ++++++++++-------- .../Dialog/BaseDialog/BaseDialog.types.ts | 10 +- src/components/Dialog/Dialog.tsx | 110 +++++++------ src/components/InfoBar/InfoBar.tsx | 118 ++++++++------ src/components/InfoBar/InfoBar.types.ts | 12 +- src/components/Inputs/Input.types.ts | 22 ++- src/components/Inputs/SearchBox/SearchBox.tsx | 2 + src/components/Inputs/TextArea/TextArea.tsx | 4 +- src/components/Inputs/TextInput/TextInput.tsx | 4 +- src/components/Label/Label.tsx | 3 +- src/components/Label/Label.types.ts | 3 +- src/components/List/List.tsx | 3 +- src/components/List/List.types.ts | 11 +- src/components/MatchScore/MatchScore.tsx | 81 +++++---- src/components/MatchScore/MatchScore.types.ts | 7 +- src/components/Menu/Menu.tsx | 4 +- src/components/Modal/Modal.tsx | 82 +++++----- src/components/OcBase/Base.types.ts | 12 ++ src/components/OcBase/index.ts | 1 + src/components/Panel/Panel.tsx | 2 + src/components/Panel/Panel.types.ts | 3 +- src/components/Pills/Pill.tsx | 144 ++++++++-------- src/components/Pills/Pills.types.ts | 3 +- src/components/Snackbar/Snackbar.test.tsx | 1 - src/components/Snackbar/Snackbar.types.ts | 2 +- src/components/Snackbar/SnackbarContainer.tsx | 2 +- src/components/Tabs/Tab/Tab.tsx | 104 ++++++------ src/components/Tabs/Tabs.types.ts | 18 +- src/components/Tabs/Tabs/AnimatedTabs.tsx | 61 ++++--- src/components/Tabs/Tabs/index.tsx | 22 ++- .../Tabs/__snapshots__/Tabs.test.tsx.snap | 1 + src/components/Tooltip/Tooltip.tsx | 2 + src/components/Tooltip/Tooltip.types.ts | 11 +- 39 files changed, 578 insertions(+), 483 deletions(-) create mode 100644 src/components/OcBase/Base.types.ts create mode 100644 src/components/OcBase/index.ts diff --git a/src/__snapshots__/storybook.test.js.snap b/src/__snapshots__/storybook.test.js.snap index 03d470538..a9b09e6a9 100644 --- a/src/__snapshots__/storybook.test.js.snap +++ b/src/__snapshots__/storybook.test.js.snap @@ -848,7 +848,10 @@ Array [ className="mainWrapper" >