Skip to content

Commit

Permalink
Upgrade MUI & Regenerate declarations
Browse files Browse the repository at this point in the history
* Material `5.15.9`
* Icons `5.15.9`
* Base `5.0.0-beta.36`
* System `5.15.9`
* Lab `5.0.0-alpha.165`
  • Loading branch information
aerialist7 committed Feb 11, 2024
1 parent 311eea8 commit 9fc5ab7
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 126 deletions.
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/karakum/mui/KotlinType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ private val STANDARD_TYPE_MAP = mapOf(

"Date" to "kotlin.js.Date",

"keyof HTMLElementTagNameMap" to "String /* keyof HTMLElementTagNameMap */",

"readonly CalendarPickerView[]" to "ReadonlyArray<CalendarPickerView>",
"Breakpoint[]" to "ReadonlyArray<Breakpoint>",
"UsePaginationItem[]" to "ReadonlyArray<UsePaginationItem>",
Expand Down Expand Up @@ -237,7 +239,7 @@ private val STANDARD_TYPE_MAP = mapOf(
"Any /* <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseMenuButtonRootSlotProps<ExternalProps> */",

"StateChangeCallback<State>" to "Any /* StateChangeCallback<State> */",
"PopperProps['anchorEl']" to "Any /* PopperProps['anchorEl'] */",
"PopupProps['anchorEl']" to "Any /* PopupProps['anchorEl'] */",
)

internal fun kotlinType(
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 @@ -20,6 +20,10 @@ internal fun fixOverrides(
-> content
.override("classes")

"Button",
-> content
.override("rootElementName")

"CardActionArea",
-> content
.override("classes")
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ kfc.version=7.34.0
# TEMP
kfc.es.mode=false
seskar.version=2.23.0
mui-material.version=5.15.7
mui-icons-material.version=5.15.7
mui-base.version=5.0.0-beta.34
mui-system.version=5.15.7
mui-lab.version=5.0.0-alpha.163
mui-material.version=5.15.9
mui-icons-material.version=5.15.9
mui-base.version=5.0.0-beta.36
mui-system.version=5.15.9
mui-lab.version=5.0.0-alpha.165
mui-x-date-pickers.version=5.0.20
mui-x-tree-view.version=6.17.0
kotlin-wrappers.version=1.0.0-pre.684
6 changes: 6 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/base/Button.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ external interface ButtonOwnProps :
* @default {}
*/
var slots: ButtonSlots?

/**
* The HTML element that is ultimately rendered, for example 'button' or 'a'
* @default 'button'
*/
override var rootElementName: String? /* keyof HTMLElementTagNameMap */
}

external interface ButtonSlots {
Expand Down
4 changes: 2 additions & 2 deletions mui-kotlin/src/jsMain/kotlin/mui/base/Menu.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ external interface MenuOwnProps :
/**
* The element based on which the menu is positioned.
*/
var anchor: Any? /* PopperProps['anchorEl'] */
var anchor: Any? /* PopupProps['anchor'] */

override var children: react.ReactNode?

Expand All @@ -50,7 +50,7 @@ external interface MenuOwnProps :
var slotProps: SlotProps?

interface SlotProps {
var root: react.Props? /* SlotComponentProps<'div', MenuRootSlotPropsOverrides, MenuOwnerState> & Partial<React.ComponentPropsWithoutRef<typeof Popper>> */
var root: react.Props? /* SlotComponentProps<'div', MenuRootSlotPropsOverrides & PopupProps, MenuOwnerState> */
var listbox: react.Props? /* SlotComponentProps<'ul', MenuListboxSlotPropsOverrides, MenuOwnerState> */
}

Expand Down
6 changes: 6 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useButton.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ external interface UseButtonParameters {
* @default 'button'
*/
var type: dynamic /* React.ButtonHTMLAttributes<HTMLButtonElement>['type'] */

/**
* The HTML element, e.g.'button', 'a' etc
* @default ''
*/
var rootElementName: String? /* keyof HTMLElementTagNameMap */
}

external interface UseButtonRootSlotOwnProps : react.Props {
Expand Down
6 changes: 6 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useSlider.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ external interface UseSliderParameters {
*/
var scale: ((value: Number) -> Number)?

/**
* The granularity with which the slider can step through values when using Page Up/Page Down or Shift + Arrow Up/Arrow Down.
* @default 10
*/
var shiftStep: Number?

/**
* The granularity with which the slider can step through values. (A "discrete" slider.)
* The `min` prop serves as the origin for the valid values.
Expand Down
4 changes: 2 additions & 2 deletions mui-kotlin/src/jsMain/kotlin/mui/material/Accordion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ external interface AccordionProps :
/**
* The component used for the transition.
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
* @deprecated Use `slots.transition` instead. This prop will be removed in v7.
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
*/
var TransitionComponent: react.ComponentType<*>?

/**
* Props applied to the transition element.
* By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7.
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
*/
var TransitionProps: mui.material.transitions.TransitionProps?
}
Expand Down
2 changes: 1 addition & 1 deletion mui-kotlin/src/jsMain/kotlin/mui/material/Divider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ external interface DividerOwnProps :
/**
* If `true`, the divider will have a lighter color.
* @default false
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
* @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
*/
var light: Boolean?

Expand Down
6 changes: 6 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/material/Slider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ external interface SliderOwnProps :
*/
var scale: ((value: Number) -> Number)?

/**
* The granularity with which the slider can step through values when using Page Up/Page Down or Shift + Arrow Up/Arrow Down.
* @default 10
*/
var shiftStep: Number?

/**
* The size of the slider.
* @default 'medium'
Expand Down
Loading

0 comments on commit 9fc5ab7

Please sign in to comment.