From 531d101d36e4ca5a92fd6f516cf55e3fa77089c8 Mon Sep 17 00:00:00 2001 From: Brion Date: Thu, 17 Oct 2024 16:07:32 +0530 Subject: [PATCH 01/19] fix(react): password eye icon not working without criteria --- packages/react/src/components/TextField/TextField.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react/src/components/TextField/TextField.tsx b/packages/react/src/components/TextField/TextField.tsx index edb01ba9..1bfd3753 100644 --- a/packages/react/src/components/TextField/TextField.tsx +++ b/packages/react/src/components/TextField/TextField.tsx @@ -94,7 +94,7 @@ const PasswordField: ForwardRefExoticComponent = forwardRef( const PasswordFieldWithCriteria: ForwardRefExoticComponent = forwardRef( ( - {criteria, id, type, ...rest}: TextFieldProps, + {criteria, id, ...rest}: TextFieldProps, ref: Ref, ): ReactElement => { const [openPasswordCriteriaTooltip, setOpenPasswordCriteriaTooltip] = useState(false); @@ -138,7 +138,6 @@ const PasswordFieldWithCriteria: ForwardRefExoticComponent = for Date: Fri, 18 Oct 2024 00:05:34 +0530 Subject: [PATCH 02/19] feat(react): add `readonly` variant styles --- .../TextField/TextField.stories.mdx | 37 ++++++++++++------- .../src/components/TextField/TextField.tsx | 2 +- .../src/components/TextField/text-field.scss | 12 +++++- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/packages/react/src/components/TextField/TextField.stories.mdx b/packages/react/src/components/TextField/TextField.stories.mdx index 3c826bfd..d5da0f70 100644 --- a/packages/react/src/components/TextField/TextField.stories.mdx +++ b/packages/react/src/components/TextField/TextField.stories.mdx @@ -1,7 +1,7 @@ import {ArgsTable, Source, Story, Canvas, Meta} from '@storybook/addon-docs'; import dedent from 'ts-dedent'; -import StoryConfig from '../../../.storybook/story-config.ts'; import TextField from './TextField.tsx'; +import StoryConfig from '../../../.storybook/story-config.ts'; export const meta = { component: TextField, @@ -58,21 +58,32 @@ A component that wraps an input filed and an input label. +### Readonly + +Readonly variation of the text field. + + + + + ### Password - + ## Usage diff --git a/packages/react/src/components/TextField/TextField.tsx b/packages/react/src/components/TextField/TextField.tsx index 1bfd3753..8211723a 100644 --- a/packages/react/src/components/TextField/TextField.tsx +++ b/packages/react/src/components/TextField/TextField.tsx @@ -188,7 +188,7 @@ const TextField: OverridableComponent> = forw {type === TextFieldInputTypes.INPUT_PASSWORD ? ( ) : ( - + )} ); diff --git a/packages/react/src/components/TextField/text-field.scss b/packages/react/src/components/TextField/text-field.scss index dd90d90b..ff0fd7b7 100644 --- a/packages/react/src/components/TextField/text-field.scss +++ b/packages/react/src/components/TextField/text-field.scss @@ -16,8 +16,16 @@ * under the License. */ -.oxygen-text-field { - /* Add Styles */ +:root { + --oxygen-palette-ReadOnlyInput-bg: #e9ecef; +} + +.OxygenTextField-root { + .Mui-readOnly, + .MuiInputBase-readOnly { + cursor: default; + background: var(--oxygen-palette-ReadOnlyInput-bg); + } } .oxygen-text-field-tooltip { From 35f6e570866e63012d7d0714431a9f83248afd73 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 18 Oct 2024 00:05:56 +0530 Subject: [PATCH 03/19] feat(react): override `MuiOutlinedInput` padding --- packages/react/src/theme/default-theme.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react/src/theme/default-theme.ts b/packages/react/src/theme/default-theme.ts index 0202ee17..cd05d82f 100644 --- a/packages/react/src/theme/default-theme.ts +++ b/packages/react/src/theme/default-theme.ts @@ -153,6 +153,13 @@ export const generateDefaultThemeOptions = (baseTheme: Theme): RecursivePartial< }, }, }, + MuiOutlinedInput: { + styleOverrides: { + input: { + padding: '0.67857143em 1em', + }, + }, + }, MuiTypography: { defaultProps: { variantMapping: { From ffc4bcd429d2f7f3e157819f7c06374d7d8e0780 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 18 Oct 2024 00:07:09 +0530 Subject: [PATCH 04/19] feat(primitives): add `CloneIcon` --- packages/primitives/src/icons/clone-16.svg | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/primitives/src/icons/clone-16.svg diff --git a/packages/primitives/src/icons/clone-16.svg b/packages/primitives/src/icons/clone-16.svg new file mode 100644 index 00000000..7985c2dc --- /dev/null +++ b/packages/primitives/src/icons/clone-16.svg @@ -0,0 +1,23 @@ + + + + + From 58a74e3b21ed58d690b973f6fe8e0da6c047a991 Mon Sep 17 00:00:00 2001 From: Brion Date: Fri, 18 Oct 2024 00:07:22 +0530 Subject: [PATCH 05/19] feat(primitives): add `GlobeIcon` --- packages/primitives/src/icons/globe-16.svg | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/primitives/src/icons/globe-16.svg diff --git a/packages/primitives/src/icons/globe-16.svg b/packages/primitives/src/icons/globe-16.svg new file mode 100644 index 00000000..674746bb --- /dev/null +++ b/packages/primitives/src/icons/globe-16.svg @@ -0,0 +1,23 @@ + + + + + From 1c86bc57d07b3cea82ea05534071a0058237bc1c Mon Sep 17 00:00:00 2001 From: Brion Date: Mon, 21 Oct 2024 00:34:38 +0530 Subject: [PATCH 06/19] chore(react): update snapshots --- .../__tests__/__snapshots__/Autocomplete.test.tsx.snap | 6 +++--- .../__test__/__snapshots__/OutlinedInput.test.tsx.snap | 4 ++-- .../__snapshots__/PhoneNumberInput.test.tsx.snap | 8 ++++---- .../__tests__/__snapshots__/Select.test.tsx.snap | 4 ++-- .../__tests__/__snapshots__/SignIn.test.tsx.snap | 10 +++++----- .../__test__/__snapshots__/TextField.test.tsx.snap | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/react/src/components/Autocomplete/__tests__/__snapshots__/Autocomplete.test.tsx.snap b/packages/react/src/components/Autocomplete/__tests__/__snapshots__/Autocomplete.test.tsx.snap index 838729e4..c7c23a16 100644 --- a/packages/react/src/components/Autocomplete/__tests__/__snapshots__/Autocomplete.test.tsx.snap +++ b/packages/react/src/components/Autocomplete/__tests__/__snapshots__/Autocomplete.test.tsx.snap @@ -18,10 +18,10 @@ exports[`Alert should match the snapshot 1`] = ` Movie
diff --git a/packages/react/src/components/PhoneNumberInput/__test__/__snapshots__/PhoneNumberInput.test.tsx.snap b/packages/react/src/components/PhoneNumberInput/__test__/__snapshots__/PhoneNumberInput.test.tsx.snap index 14fa25cd..9308fc3d 100644 --- a/packages/react/src/components/PhoneNumberInput/__test__/__snapshots__/PhoneNumberInput.test.tsx.snap +++ b/packages/react/src/components/PhoneNumberInput/__test__/__snapshots__/PhoneNumberInput.test.tsx.snap @@ -17,13 +17,13 @@ exports[`TextField should match the snapshot 1`] = ` class="oxygen-box oxygen-select-input MuiBox-root css-0" >