-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pickers] POC: PickersTextField
styling - outlined variant
#10778
Conversation
Deploy preview: https://deploy-preview-10778--material-ui-x.netlify.app/ |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Opening this one up for review to start the conversation. I still have to remove the demo, comments and some simulated behavior, but I will still leave them hanging for a little while to make the review/testing easier. |
…e-textfield-styling
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.types.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.types.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Flavien DELANGLE <[email protected]> Signed-off-by: Nora <[email protected]>
…e/mui-x into fake-textfield-styling
ca3781d
to
2aa1414
Compare
packages/x-date-pickers/src/internals/components/FakeTextField/fakeTextFieldClasses.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.tsx
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeInput.types.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/FakeTextField.types.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/internals/components/FakeTextField/fakeTextFieldClasses.ts
Outdated
Show resolved
Hide resolved
PickersTextField
styling - outlined variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an awesome first step
Can I let you update your branch where you have my code to use the new FakeTextField
and push it to Github so that I can take it from here on my PR?
@flaviendelangle Thanks! Sure, I'll let you know when it's updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Thank you for the effort! 🙏
@@ -0,0 +1,84 @@ | |||
import * as React from 'react'; | |||
import { styled } from '@mui/material/styles'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: This looks like a copy of https://github.com/mui/material-ui/blob/master/packages/mui-material/src/OutlinedInput/NotchedOutline.js
If that's the case, maybe we could mention it? 🤔
notchedOutline: string; | ||
/** Styles applied to the fake input element. */ | ||
input: string; | ||
/** Styles applied to the section of the picker. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Isn't there something missing from this description? 🤔
error: string; | ||
/** Styles applied to the NotchedOutline element. */ | ||
notchedOutline: string; | ||
/** Styles applied to the fake input element. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could make sense to avoid the fake
work here as well. 🤔
Maybe call it input sections container
instead of fake input
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in #11258 where I'm renaming this class
firstInput.focus(); | ||
} | ||
|
||
inputRef.current?.focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Is it the correct location to call it?
If we need/should focus both the root element as well as optionally the first section, then maybe the order should be inverted? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in #11258
This PR is still work in progress
Part of #6384
Preview:
https://deploy-preview-10778--material-ui-x.netlify.app/x/react-date-pickers/date-field/
To do in scope of this PR
HelperText