Skip to content
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

[docs] Add introduction Base component demos & general uplift #33896

Merged
merged 40 commits into from Aug 29, 2022

Conversation

danilo-leal
Copy link
Contributor

@danilo-leal danilo-leal commented Aug 12, 2022

I'm experimenting with a way to present the Base components visually more interestingly above the fold. I've created a new DemoRootMaterial variant called gradient where I'm playing around with a mesh gradient and might try textures too. I've been enjoying this direction and feel like it has potential! Here's a sneak peek:

Deploy preview: https://deploy-preview-33896--material-ui.netlify.app/base/react-button/

Screen Shot 2022-08-12 at 03 45 57

Screen Shot 2022-08-12 at 03 46 02

@danilo-leal danilo-leal added docs Improvements or additions to the documentation package: base-ui Specific to @mui/base labels Aug 12, 2022
@danilo-leal danilo-leal marked this pull request as draft August 12, 2022 06:49
@mui-bot
Copy link

mui-bot commented Aug 12, 2022

No bundle size changes

Generated by 🚫 dangerJS against af1b4f0

@danilo-leal danilo-leal changed the title [docs] Uplift to the Base component demos [docs] Add introduction Base component demos & general uplift Aug 22, 2022
@samuelsycamore
Copy link
Member

I love this!! Can't wait to see it in action in the docs! Really makes a huge improvement to the overall UX.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much much better 👍 If it is up to me, I would ship it :D I especially like the grid texture

Not related to this PR, but we probably want to tweak the styles for the initial focus element on the demos at least on the base pages (probably on Joy UI too). I am talking about this hidden focusable button in the upper left corner:

image

@michaldudak
Copy link
Member

That's a huge improvement over the previous demos!
The background in the light mode looks great now. Could we make the one in dark mode a bit more subtle, though? IMO it would look better if it was darker than the grid lines.

Why don't we have the *Introduction demos in TypeScript?

@danilo-leal
Copy link
Contributor Author

danilo-leal commented Aug 26, 2022

@michaldudak just turned them all into TypeScript but I'm now getting what seems to be augmentation errors?!
I would love a hand in here ✋.

@michaldudak
Copy link
Member

michaldudak commented Aug 26, 2022

@danilo-leal There were some type definitions missing from function parameters. I fixed them.

For the future - it's best to copy a TS demo, modify it, and then run yarn docs:typescript:formatted to generate a JS version out of it. We generally don't edit JS demos directly anymore.

There are errors in regression tests of UnstyledBadge and UnstyledBadgeIntroduction demos. theme.palette.grey can't be accessed in Base demos, as it doesn't exist (these default values only are set in the Material UI theme).

@danilo-leal
Copy link
Contributor Author

@michaldudak cool, thanks for helping out! It seems the regression check is still failing, any idea how to turn it green?

@oliviertassinari

This comment was marked as resolved.

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great!

transform: translate(50%, -50%);
transform-origin: 100% 0;
transform-origin: 100% 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
transform-origin: 100% 0;
transform-origin: 100% 0;

docs/data/base/components/badge/BadgeMax.tsx Outdated Show resolved Hide resolved
docs/data/base/components/badge/ShowZeroBadge.tsx Outdated Show resolved Hide resolved
theme.palette.primaryDark[500],
0.8,
)} 0px, transparent 50%),
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23003A75' fill-opacity='0.15'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1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5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if using an SVG file would help with bundle size. For example, want we don't have introduction demos on MUI X docs pages.

@@ -14,6 +14,8 @@ githubLabel: 'component: input'
An input is a UI element that accepts text data from the user.
The `InputUnstyled` component replaces the native HTML `<input>` tag, and can also be transformed into a `<textarea>` as needed.

{{"demo": "UnstyledInputIntroduction.tsx", "defaultCodeOpen": false, "bg": "gradient"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danilo-leal Did you consider rendering this demo before everything else and a bit smaller in height? I had a quick try at it, here is what the difference looks like:

Current:

Screenshot 2022-08-27 at 00 26 05

https://deploy-preview-33896--material-ui.netlify.app/base/react-input/

With the diff

Screenshot 2022-08-27 at 00 24 57

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 26, 2022

cool, thanks for helping out! It seems the regression check is still failing, any idea how to turn it green?

@danilo-leal It seems to be an issue with the theme. I'm pushing a fix. I'm actually surprised that the correct error message isn't reported by CircleCI. I thought I had made a fix for this a year ago, unless it was only applied on MUI X 🤔

michaldudak and others added 2 commits August 29, 2022 18:24
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@michaldudak
Copy link
Member

I applied the majority of Olivier's suggestions so we can close this PR and iterate on improvements in another one after Danilo is back.

@michaldudak michaldudak merged commit b73c194 into mui:master Aug 29, 2022
@danilo-leal danilo-leal deleted the base-demos-uplift branch September 5, 2022 02:43
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
)

Co-authored-by: Michał Dudak <michal@dudak.me>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants