Skip to content

Commit

Permalink
Upgrade MUI & Regenerate declarations
Browse files Browse the repository at this point in the history
* Material `5.15.2`
* Icons `5.15.2`
* Base `5.0.0-beta.29`
* System `5.15.2`
* Lab `5.0.0-alpha.158`
  • Loading branch information
aerialist7 committed Jan 13, 2024
1 parent 52a576a commit 0f5c617
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 119 deletions.
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/karakum/mui/FunctionConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ internal fun findDefaultFunction(
"useSwitch",
"useOption",
"useTreeItem",
"useTransitionTrigger",
"useTransitionStateManager",
-> initialContent.replace("export declare function $name", "$DEFAULT_FUNCTION_PREFIX$name")

"useSelect",
Expand Down
20 changes: 16 additions & 4 deletions buildSrc/src/main/kotlin/karakum/mui/Generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,22 @@ private fun generateBaseDeclarations(
"useCompound",
)

if (dir.name in ignoredHooksDefaultFiles)
files
else
files + component
when (dir.name) {
in ignoredHooksDefaultFiles -> files
"Transitions" -> dir.existed(
"CssAnimation.d.ts",
"CssTransition.d.ts",
)

"useTransition" -> dir.existed(
// TODO: Fix incorrect files processing and uncomment
// "TransitionContext.d.ts",
// "useTransitionStateManager.d.ts",
// "useTransitionTrigger.d.ts",
)

else -> files + component
}
}
.forEach { generate(it, targetDir, Package.base) }
}
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.22.0
mui-material.version=5.15.1
mui-icons-material.version=5.15.1
mui-base.version=5.0.0-beta.28
mui-system.version=5.15.1
mui-lab.version=5.0.0-alpha.157
mui-material.version=5.15.2
mui-icons-material.version=5.15.2
mui-base.version=5.0.0-beta.29
mui-system.version=5.15.2
mui-lab.version=5.0.0-alpha.158
mui-x-tree-view.version=6.17.0
mui-x-date-pickers.version=5.0.4
kotlin-wrappers.version=1.0.0-pre.682
51 changes: 51 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/base/CssAnimation.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Automatically generated - do not modify!

@file:JsModule("@mui/base/CssAnimation")

package mui.base

import web.cssom.ClassName

external interface CssAnimationProps :
react.PropsWithChildren,
react.PropsWithClassName {
override var children: react.ReactNode?

override var className: ClassName?

/**
* The name of the CSS animation (the `animation-name` CSS property) applied to the component when
* the transition is requested to enter.
*/
var enterAnimationName: String?

/**
* The name of the CSS class applied to the component when the transition
* is requested to enter.
*/
var enterClassName: ClassName?

/**
* The name of the CSS animation (the `animation-name` CSS property) applied to the component when
* the transition is requested to exit.
*/
var exitAnimationName: String?

/**
* The name of the CSS class applied to the component when the transition
* is requested to exit.
*/
var exitClassName: ClassName?
}

/**
*
* Demos:
*
* - [Transitions](https://mui.com/base-ui/react-transitions/)
*
* API:
*
* - [CssAnimation API](https://mui.com/base-ui/react-transitions/components-api/#css-animation)
*/
external val CssAnimation: react.FC<CssAnimationProps>
57 changes: 57 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/base/CssTransition.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Automatically generated - do not modify!

@file:JsModule("@mui/base/CssTransition")

package mui.base

import web.cssom.ClassName

external interface CssTransitionProps :
react.PropsWithChildren,
react.PropsWithClassName {
override var children: react.ReactNode?

override var className: ClassName?

/**
* The name of the CSS class applied to the component when the transition
* is requested to enter.
*/
var enterClassName: ClassName?

/**
* The name of the CSS class applied to the component when the transition
* is requested to exit.
*/
var exitClassName: ClassName?

/**
* The name of the CSS property that is transitioned the longest (has the largest `transition-duration`) on enter.
* This is used to determine when the transition has ended.
* If not specified, the transition will be considered finished end when the first property is transitioned.
* If all properties have the same `transition-duration` (or there is just one transitioned property), this can be omitted.
*/
var lastTransitionedPropertyOnEnter: String?

/**
* The name of the CSS property that is transitioned the longest (has the largest `transition-duration`) on exit.
* This is used to determine when the transition has ended.
* If not specified, the transition will be considered finished end when the first property is transitioned.
* If all properties have the same `transition-duration` (or there is just one transitioned property), this can be omitted.
*/
var lastTransitionedPropertyOnExit: String?
}

/**
* A utility component that hooks up to the Base UI transitions API and
* applies a CSS transition to its children when necessary.
*
* Demos:
*
* - [Transitions](https://mui.com/base-ui/react-transitions/)
*
* API:
*
* - [CssTransition API](https://mui.com/base-ui/react-transitions/components-api/#css-transition)
*/
external val CssTransition: react.FC<CssTransitionProps>
1 change: 0 additions & 1 deletion mui-kotlin/src/jsMain/kotlin/mui/base/Select.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ external interface SelectOwnProps<OptionValue> :

/**
* Name of the element. For example used by the server to identify the fields in form submits.
* If the name is provided, the component will render a hidden input element that can be submitted to a server.
*/
var name: String?

Expand Down
50 changes: 50 additions & 0 deletions mui-kotlin/src/jsMain/kotlin/mui/material/Paper.classes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,79 @@ external interface PaperClasses {

/** Styles applied to the root element if `variant="elevation"`. */
var elevation: ClassName

/** Styles applied to the root element if `elevation={0}`. */
var elevation0: ClassName

/** Styles applied to the root element if `elevation={1}`. */
var elevation1: ClassName

/** Styles applied to the root element if `elevation={2}`. */
var elevation2: ClassName

/** Styles applied to the root element if `elevation={3}`. */
var elevation3: ClassName

/** Styles applied to the root element if `elevation={4}`. */
var elevation4: ClassName

/** Styles applied to the root element if `elevation={5}`. */
var elevation5: ClassName

/** Styles applied to the root element if `elevation={6}`. */
var elevation6: ClassName

/** Styles applied to the root element if `elevation={7}`. */
var elevation7: ClassName

/** Styles applied to the root element if `elevation={8}`. */
var elevation8: ClassName

/** Styles applied to the root element if `elevation={9}`. */
var elevation9: ClassName

/** Styles applied to the root element if `elevation={10}`. */
var elevation10: ClassName

/** Styles applied to the root element if `elevation={11}`. */
var elevation11: ClassName

/** Styles applied to the root element if `elevation={12}`. */
var elevation12: ClassName

/** Styles applied to the root element if `elevation={13}`. */
var elevation13: ClassName

/** Styles applied to the root element if `elevation={14}`. */
var elevation14: ClassName

/** Styles applied to the root element if `elevation={15}`. */
var elevation15: ClassName

/** Styles applied to the root element if `elevation={16}`. */
var elevation16: ClassName

/** Styles applied to the root element if `elevation={17}`. */
var elevation17: ClassName

/** Styles applied to the root element if `elevation={18}`. */
var elevation18: ClassName

/** Styles applied to the root element if `elevation={19}`. */
var elevation19: ClassName

/** Styles applied to the root element if `elevation={20}`. */
var elevation20: ClassName

/** Styles applied to the root element if `elevation={21}`. */
var elevation21: ClassName

/** Styles applied to the root element if `elevation={22}`. */
var elevation22: ClassName

/** Styles applied to the root element if `elevation={23}`. */
var elevation23: ClassName

/** Styles applied to the root element if `elevation={24}`. */
var elevation24: ClassName
}
Loading

0 comments on commit 0f5c617

Please sign in to comment.