Skip to content

Commit

Permalink
mui-material.version=5.15.19
Browse files Browse the repository at this point in the history
mui-icons-material.version=5.15.19
mui-base.version=5.0.0-beta.47
  • Loading branch information
aerialist7 committed Jun 2, 2024
1 parent 94a6fb0 commit ffe9fed
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 180 deletions.
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/karakum/mui/KotlinType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ private val STANDARD_TYPE_MAP = mapOf(
"React.Dispatch<React.SetStateAction<boolean>>" to "react.StateSetter<Boolean>",

"React.ReactElement" to "react.ReactElement<*>",
"React.ReactElement<any>" to "react.ReactElement<*>",
"React.ReactElement<any, any>" to "react.ReactElement<*>",
"NonNullable<React.ReactElement>" to "react.ReactElement<*>",

Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/karakum/mui/Override.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ internal val OVERRIDE_FIX_REQUIRED = setOf(
)

internal val VAR_TYPE_MISMATCH_ON_OVERRIDE_FIX_REQUIRED = setOf(
"AlertTitle",
"CardHeader",
"BottomNavigationAction",
"StepButton",
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/kotlin/karakum/mui/Overrides.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ internal fun fixOverrides(
content: String,
): String =
when (name) {
"AlertTitle",
-> content
.override("classes")

"Autocomplete",
-> content
.override("disabled")
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/karakum/mui/ParentType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ internal fun findParentType(
).joinToString(",", "\n")
}

if (parentSource.startsWith("TypographyProps<")) {
val (first, _) = parentSource.split("<")
return first
}

return when (parentSource) {
"ButtonBaseProps",
"ListItemBaseProps",
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/karakum/mui/adapters/Option.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface OptionTypeMap<OptionValue, AdditionalProps = {}, RootComponentT
).replace(
"""
export interface OptionType {
<OptionValue, RootComponentType extends React.ElementType = OptionTypeMap<OptionValue>['defaultComponent']>(props: PolymorphicProps<OptionTypeMap<OptionValue>, RootComponentType>): JSX.Element | null;
<OptionValue, RootComponentType extends React.ElementType = OptionTypeMap<OptionValue>['defaultComponent']>(props: PolymorphicProps<OptionTypeMap<OptionValue>, RootComponentType>): React.JSX.Element | null;
propTypes?: any;
displayName?: string | undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/karakum/mui/adapters/Select.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface SelectTypeMap<OptionValue extends {}, Multiple extends boolean,
).replace(
"""
export interface SelectType {
<OptionValue extends {}, Multiple extends boolean = false, RootComponentType extends React.ElementType = SelectTypeMap<OptionValue, Multiple>['defaultComponent']>(props: PolymorphicProps<SelectTypeMap<OptionValue, Multiple>, RootComponentType>): JSX.Element | null;
<OptionValue extends {}, Multiple extends boolean = false, RootComponentType extends React.ElementType = SelectTypeMap<OptionValue, Multiple>['defaultComponent']>(props: PolymorphicProps<SelectTypeMap<OptionValue, Multiple>, RootComponentType>): React.JSX.Element | null;
propTypes?: any;
displayName?: string | undefined;
}
Expand Down
19 changes: 12 additions & 7 deletions buildSrc/src/main/kotlin/karakum/mui/adapters/useAutocomplete.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ package karakum.mui.adapters
// TODO: Remove when default function for `useAutocomplete` will be supported
fun String.adaptUseAutocomplete(): String {
return replace(
"""export interface UseAutocompleteParameters<
oldValue = """export interface UseAutocompleteParameters<
Value,
Multiple extends boolean | undefined,
DisableClearable extends boolean | undefined,
FreeSolo extends boolean | undefined,
> extends UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo> {}""",
"",
).replace(
" getInputProps: () => React.InputHTMLAttributes<HTMLInputElement> & {\n" +
" ref: React.Ref<HTMLInputElement>;\n" +
" };",
" getInputProps: () => React.InputHTMLAttributes<HTMLInputElement>;"
newValue = "",
)
.replace(
oldValue = " getInputProps: () => React.InputHTMLAttributes<HTMLInputElement> & {\n" +
" ref: React.Ref<HTMLInputElement>;\n" +
" };",
newValue = " getInputProps: () => React.InputHTMLAttributes<HTMLInputElement>;"
)
.replace(
oldValue = "React.HTMLAttributes<HTMLLIElement> & { key: any }",
newValue = "React.HTMLAttributes<HTMLLIElement>",
)
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kotlin-wrappers.version=1.0.0-pre.754
kfc.version=8.1.0
seskar.version=2.80.0
# MUI Deps
mui-material.version=5.15.18
mui-icons-material.version=5.15.18
mui-base.version=5.0.0-beta.45
mui-material.version=5.15.19
mui-icons-material.version=5.15.19
mui-base.version=5.0.0-beta.47
mui-system.version=5.15.15
mui-lab.version=5.0.0-alpha.170
mui-x-date-pickers.version=5.0.20
Expand Down
9 changes: 6 additions & 3 deletions mui-kotlin/src/jsMain/kotlin/mui/material/AlertTitle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

@file:JsModule("@mui/material/AlertTitle")

@file:Suppress(
"VAR_TYPE_MISMATCH_ON_OVERRIDE",
)

package mui.material

import mui.material.styles.Theme
import mui.system.SxProps

external interface AlertTitleProps :
mui.system.StandardProps,
react.dom.html.HTMLAttributes<web.html.HTMLDivElement>,
TypographyProps,
react.PropsWithChildren,
mui.system.PropsWithSx {
/**
Expand All @@ -20,7 +23,7 @@ external interface AlertTitleProps :
/**
* Override or extend the styles applied to the component.
*/
var classes: AlertTitleClasses?
override var classes: AlertTitleClasses?

/**
* The system prop that allows defining system overrides as well as additional CSS styles.
Expand Down
2 changes: 2 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/material/Hidden.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ external interface HiddenProps : react.PropsWithChildren {
* API:
*
* - [Hidden API](https://mui.com/material-ui/api/hidden/)
*
* @deprecated The Hidden component was deprecated in Material UI v5. To learn more, see [the Hidden section](/material-ui/migration/v5-component-changes/#hidden) of the migration docs.
*/
@JsName("default")
external val Hidden: react.FC<HiddenProps>
2 changes: 1 addition & 1 deletion mui-kotlin/src/jsMain/kotlin/mui/material/usePagination.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ external interface UsePaginationProps : react.Props {
var onChange: ((event: react.dom.events.ChangeEvent<*>, page: Number) -> Unit)?

/**
* The current page.
* The current page. Unlike `TablePagination`, which starts numbering from `0`, this pagination starts from `1`.
*/
var page: Number?

Expand Down
Loading

0 comments on commit ffe9fed

Please sign in to comment.