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

[Feature] Refactor theming of Admin components to remove legacy @mui/styles package #1376

Merged
merged 81 commits into from
Mar 19, 2024

Conversation

jamesricky
Copy link
Contributor

No description provided.

@jamesricky jamesricky self-assigned this Nov 7, 2023
jamesricky and others added 2 commits November 13, 2023 17:07
Instead of requiring all props when setting the `defaultProps` of a
component.
Co-authored-by: Thomas Dax <thomas.dax@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
@jamesricky jamesricky changed the base branch from ubernext to next November 27, 2023 05:55
Extending a Comet Admin component using `styled()` requires the
`className` prop to be passed through to the components `root` slot.

Also added the `ThemedComponentBaseProps` type to use as a base for
components props.
This abstracts away the need to manually define the `sx`, `className`
and `slotProps` props in every component.
Merge next into feature/refactor-admin-component-theming
Copying the styling and `overridesResolver` from MUIs TooltipPopper is
required because when overriding the Tooltips Popper we cannot extend
the existing Popper.

Overriding the Popper is required to implement our variant-specific
styling, as we cannot set the styles from the Root element, as the
Popper is not rendered as a child of the Tooltip in the DOM.
Refactoring to a function-component is not possible, as there is no
alternative to `componentDidCatch`,
according to the [React
Docs](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary):

> There is currently no way to write an error boundary as a function
component.
To use `ownerState` and lowercase slot names.
@johnnyomair johnnyomair changed the title FEATURE: Refactor theming of admin components to remove the legacy @mui/styles package [Feature] Refactor theming of Admin components to remove legacy @mui/styles package Nov 29, 2023
Co-authored-by: Johannes Obermair <johannes.obermair@vivid-planet.com>
@jamesricky jamesricky force-pushed the feature/refactor-admin-component-theming branch from 63ae79c to b87c3c2 Compare January 4, 2024 10:44
NataliaVizintini and others added 11 commits January 22, 2024 16:40
---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
<img width="769" alt="Screenshot 2024-01-11 at 13 53 34"
src="https://github.com/vivid-planet/comet/assets/72875628/d879c8ee-f444-471c-8943-bdb6414e86a1">

I couldn't find how to use focusVisible and
[`.${inputAdornmentClasses.positionEnd}:last-child &`], please comment

---------

Co-authored-by: Ricky James Smith <jamesricky@me.com>
Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
<img width="1661" alt="Screenshot 2024-01-23 at 13 43 12"
src="https://github.com/vivid-planet/comet/assets/109900447/422a7389-ddae-429a-87cc-97ebc0ee9a6a">

Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
andrearutrecht and others added 20 commits February 19, 2024 10:49
![Screenshot 2024-02-19 at 17 59
03](https://github.com/vivid-planet/comet/assets/109900447/47e20aca-189b-4a10-84d6-5265f8f1ddf6)

---------

Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
Co-authored-by: Ricky James Smith <jamesricky@me.com>
<img width="336" alt="Screenshot 2024-01-22 at 14 19 12"
src="https://github.com/vivid-planet/comet/assets/109900447/d1322d17-723b-469d-9021-23cd23a4e7b3">

---------

Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
<details>
    <summary>CopyToClipboardButton</summary>


https://github.com/vivid-planet/comet/assets/71731085/049cccc2-4c97-4d43-a426-9fef891da0c3

</details>

<details>
    <summary>Themed CopyToClipboardButton</summary>


![comet-copyToClipboardButton-themed](https://github.com/vivid-planet/comet/assets/71731085/3a29f7c5-ab59-4109-b661-39be0f3ca0fe)

</details>

---------

Co-authored-by: Stefanie Kaltenhauser <stefanie.kaltenhauser@vivid-planet.com>
<img width="675" alt="Screenshot 2024-02-20 at 11 03 52"
src="https://github.com/vivid-planet/comet/assets/109900447/6ef65283-10de-4736-bbd2-5d24fc365a27">



<img width="681" alt="Screenshot 2024-02-20 at 11 03 59"
src="https://github.com/vivid-planet/comet/assets/109900447/a0663357-328d-4850-88df-bb9685c9865d">

---------

Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
Co-authored-by: Ricky James Smith <jamesricky@me.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
<img width="553" alt="Screenshot 2024-02-01 at 14 12 05"
src="https://github.com/vivid-planet/comet/assets/109900447/388cb711-d910-431c-a238-958126e73420">

---------

Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
Co-authored-by: Ricky James Smith <jamesricky@me.com>
<details>
    <summary>CopyToClipboardButton</summary>


https://github.com/vivid-planet/comet/assets/71731085/431f432b-4ac0-42b4-8b4d-e2e005f8c9a9


</details>

<details>
    <summary>Themed CopyToClipboardButton</summary>


https://github.com/vivid-planet/comet/assets/71731085/c1d4b458-8670-4501-bb83-a519f558fffc


</details>

Co-authored-by: Stefanie Kaltenhauser <stefanie.kaltenhauser@vivid-planet.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Julia Wegmayr <julia.wegmayr@vivid-planet.com>
Co-authored-by: Ricky Smith <rs@vivid-planet.com>
…factor-admin-component-theming

Merge `next` into `feature/refactor-admin-component-theming`
…entation of `DefaultTheme` (#1758)

### Refactor theming of remaining admin-components
- COM-487: `FieldSet` (Also added a dev-story)
- COM-488: `Alert`
- COM-489: `DatePickerNavigation`

### Remove module augmentation of `DefaultTheme` type
As the `@mui/styles` package is no longer used for the
styling-implementation of admin-components the `DefaultTheme` from
`@mui/styles/defaultTheme` is no longer needed and would cause a
typescript error when augmented.
…factor-admin-component-theming

Merge `next` into `feature/refactor-admin-component-theming`
Merge `next` into `feature/refactor-admin-component-theming`
Components where the `Root` slot extends from a MUI component are
affected by this issue.
Previously `withStyles()` would have added the class-names and
`styleOverrides` for every `ClassKey`, even if defined in MUI instead of
in Comet.
…mponentSlot()` (#1809)

E.g. the `Root` slot of `MainContent` will now alway the className
`CometAdminMainContent-root`.
If the `fullHeight` prop is set to true, the className
`CometAdminMainContent-fullHeight` also will be added.

This was previously done automatically, when using `withStyles()` from
the legacy `@mui/styles` package, which was removed during the theming
refactor: #1376

This now matches the behavior of Comet-Admin components before the
theming refactor and MUI components.
@jamesricky jamesricky marked this pull request as ready for review March 19, 2024 15:33
@auto-assign auto-assign bot requested a review from johnnyomair March 19, 2024 15:33
@johnnyomair johnnyomair merged commit 0f922dd into next Mar 19, 2024
11 checks passed
@johnnyomair johnnyomair deleted the feature/refactor-admin-component-theming branch June 11, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants