(type, classMap, { DIV(mapOf(), it) })
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/listitemsecondaryaction/listItemSecondaryAction.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.listitemsecondaryaction
2 |
3 | import materialui.ListItemSecondaryAction
4 | import materialui.components.MaterialStyle
5 | import materialui.components.StandardProps
6 | import react.RBuilder
7 |
8 | external interface ListItemSecondaryActionProps : StandardProps
9 |
10 | fun RBuilder.listItemSecondaryAction(rootStyle: String? = null, block: ListItemSecondaryActionElementBuilder.() -> Unit) {
11 | child(ListItemSecondaryActionElementBuilder(ListItemSecondaryAction, listOfNotNull(rootStyle?.let { MaterialStyle.root to it })).apply(block).create())
12 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/listitemtext/enums/ListItemTextStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.listitemtext.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ListItemTextStyle {
5 | root,
6 | inset,
7 | dense,
8 | primary,
9 | secondary,
10 | textDense
11 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/listitemtext/listItemText.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.listitemtext
2 |
3 | import materialui.ListItemText
4 | import materialui.components.StandardProps
5 | import materialui.components.listitemtext.enums.ListItemTextStyle
6 | import react.*
7 |
8 | external interface ListItemTextProps : StandardProps {
9 | var disableTypography: Boolean?
10 | var inset: Boolean?
11 | var primary: ReactElement?
12 | var primaryTypographyProps: PropsWithChildren?
13 | var secondary: ReactElement?
14 | var secondaryTypographyProps: PropsWithChildren?
15 | var theme: Any?
16 | }
17 |
18 | fun RBuilder.listItemText(vararg classMap: Pair
, block: ListItemTextElementBuilder.() -> Unit) {
19 | child(ListItemTextElementBuilder(ListItemText, classMap.toList()).apply(block).create())
20 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/listsubheader/enums/ListSubheaderColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.listsubheader.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ListSubheaderColor {
5 | default, primary, inherit
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/listsubheader/enums/ListSubheaderStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.listsubheader.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ListSubheaderStyle {
5 | root,
6 | colorPrimary,
7 | colorInherit,
8 | gutters,
9 | inset,
10 | sticky
11 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/menu/enums/MenuStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.menu.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class MenuStyle {
5 | paper
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/menu/menu.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.menu
2 |
3 | import materialui.Menu
4 | import materialui.components.menu.enums.MenuStyle
5 | import materialui.components.popover.PopoverProps
6 | import materialui.styles.muitheme.MuiTheme
7 | import react.RBuilder
8 | import react.PropsWithChildren
9 |
10 | external interface MenuProps : PopoverProps {
11 | var disableAutoFocusItem: Boolean?
12 | var MenuListProps: PropsWithChildren?
13 | var theme: MuiTheme?
14 | var PopoveComponentClasses: Any?
15 | }
16 |
17 | fun RBuilder.menu(vararg classMap: Pair, block: MenuElementBuilder.() -> Unit) {
18 | child(menuElement(classMap.toList(), block))
19 | }
20 | internal fun menuElement(
21 | classMap: List> = listOf(),
22 | block: MenuElementBuilder.() -> Unit
23 | ) = MenuElementBuilder(Menu, classMap.toList()).apply(block).create()
24 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/menuitem/MenuItemElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.menuitem
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.listitem.ListItemElementBuilder
6 | import materialui.components.menuitem.enums.MenuItemStyle
7 | import react.ComponentType
8 |
9 | class MenuItemElementBuilder internal constructor(
10 | type: ComponentType,
11 | classMap: List, String>>,
12 | factory: (TagConsumer) -> T
13 | ) : ListItemElementBuilder(type, classMap, factory) {
14 | fun Tag.classes(vararg classMap: Pair) {
15 | classes(classMap.toList())
16 | }
17 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/menuitem/enums/MenuItemStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.menuitem.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class MenuItemStyle {
5 | root,
6 | gutters,
7 | selected
8 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/menulist/MenuListElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.menulist
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.getValue
6 | import materialui.components.list.ListElementBuilder
7 | import materialui.components.setValue
8 | import react.ComponentType
9 |
10 | class MenuListElementBuilder internal constructor(
11 | type: ComponentType,
12 | classMap: List, String>>,
13 | factory: (TagConsumer) -> T
14 | ) : ListElementBuilder(type, classMap, factory) {
15 | var Tag.disableListWrap: Boolean? by materialProps
16 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/mobilestepper/enums/MobileStepperPosition.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.mobilestepper.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class MobileStepperPosition {
5 | bottom, top, static
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/mobilestepper/enums/MobileStepperVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.mobilestepper.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class MobileStepperVariant {
5 | text, dots, progress
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/modal/enums/ModalStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.modal.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ModalStyle {
5 | root, hidden
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/nativeselect/enums/NativeSelectStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.nativeselect.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class NativeSelectStyle {
5 | root,
6 | select,
7 | filled,
8 | outlined,
9 | selectMenu,
10 | disabled,
11 | icon
12 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/nativeselect/enums/NativeSelectVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.nativeselect.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class NativeSelectVariant {
5 | standard, outlined, filled
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/nativeselect/nativeSelect.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.nativeselect
2 |
3 | import materialui.NativeSelect
4 | import materialui.components.input.InputProps
5 | import materialui.components.nativeselect.enums.NativeSelectStyle
6 | import react.*
7 |
8 | external interface NativeSelectProps : InputProps {
9 | var IconComponent: dynamic
10 | var input: ReactElement?
11 | var variant: String?
12 | }
13 |
14 | fun RBuilder.nativeSelect(vararg classMap: Pair, block: NativeSelectElementBuilder.() -> Unit) {
15 | child(NativeSelectElementBuilder(NativeSelect, classMap.toList()).apply(block).create())
16 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/nossr/NoSsrElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.nossr
2 |
3 | import kotlinext.js.jsObject
4 | import react.*
5 |
6 | class NoSsrElementBuilder internal constructor(
7 | val type: ComponentType,
8 | private val props: NoSsrProps = jsObject { }
9 | ) : RBuilderImpl() {
10 | fun attrs(handler: NoSsrProps.() -> Unit) {
11 | props.handler()
12 | }
13 |
14 | fun create() = createElement(type, props, *childList.toTypedArray())
15 |
16 | fun NoSsrProps.fallback(block: RBuilder.() -> Unit) { fallback = buildElement(block) }
17 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/nossr/noSsr.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.nossr
2 |
3 | import materialui.NoSsr
4 | import react.RBuilder
5 | import react.PropsWithChildren
6 | import react.ReactElement
7 |
8 | external interface NoSsrProps : PropsWithChildren {
9 | var defer: Boolean?
10 | var fallback: ReactElement?
11 | }
12 |
13 | fun RBuilder.noSsr(block: NoSsrElementBuilder.() -> Unit) {
14 | child(NoSsrElementBuilder(NoSsr).apply(block).create())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/outlinedinput/OutlinedInputElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.outlinedinput
2 |
3 | import kotlinx.html.Tag
4 | import materialui.components.getValue
5 | import materialui.components.inputbase.InputBaseElementBuilder
6 | import materialui.components.outlinedinput.enums.OutlinedInputStyle
7 | import materialui.components.setValue
8 | import react.ComponentType
9 |
10 | class OutlinedInputElementBuilder internal constructor(
11 | type: ComponentType,
12 | classMap: List, String>>
13 | ) : InputBaseElementBuilder(type, classMap) {
14 | fun Tag.classes(vararg classMap: Pair) {
15 | classes(classMap.toList())
16 | }
17 |
18 | var Tag.labelWidth: Number? by materialProps
19 | var Tag.notched: Boolean? by materialProps
20 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/outlinedinput/enums/OutlinedInputStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.outlinedinput.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class OutlinedInputStyle {
5 | root,
6 | focused,
7 | disabled,
8 | adornedStart,
9 | adornedEnd,
10 | error,
11 | multiline,
12 | notchedOutline,
13 | input,
14 | inputMarginDense,
15 | inputMultiline,
16 | inputAdornedStart,
17 | inputAdornedEnd
18 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/outlinedinput/outlinedInput.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.outlinedinput
2 |
3 | import materialui.OutlinedInput
4 | import materialui.components.inputbase.InputBaseProps
5 | import materialui.components.outlinedinput.enums.OutlinedInputStyle
6 | import react.*
7 |
8 | external interface OutlinedInputProps : InputBaseProps {
9 | var labelWidth: Number?
10 | var notched: Boolean?
11 | }
12 |
13 | fun RBuilder.outlinedInput(vararg classMap: Pair, block: OutlinedInputElementBuilder.() -> Unit) {
14 | child(OutlinedInputElementBuilder(OutlinedInput, classMap.toList()).apply(block).create())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/paper/PaperElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.paper
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import materialui.components.getValue
7 | import materialui.components.paper.enums.PaperStyle
8 | import materialui.components.setValue
9 | import react.ComponentType
10 |
11 | open class PaperElementBuilder(
12 | type: ComponentType,
13 | classMap: List, String>>,
14 | factory: (TagConsumer) -> T
15 | ) : MaterialElementBuilder(type, classMap, factory) {
16 | fun Tag.classes(vararg classMap: Pair) {
17 | classes(classMap.map { it.first to it.second })
18 | }
19 |
20 | var Tag.elevation: Number? by materialProps
21 | var Tag.square: Boolean? by materialProps
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/paper/enums/PaperStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.paper.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class PaperStyle {
5 | root,
6 | rounded,
7 | elevation0,
8 | elevation1,
9 | elevation2,
10 | elevation3,
11 | elevation4,
12 | elevation5,
13 | elevation6,
14 | elevation7,
15 | elevation8,
16 | elevation9,
17 | elevation10,
18 | elevation11,
19 | elevation12,
20 | elevation13,
21 | elevation14,
22 | elevation15,
23 | elevation16,
24 | elevation17,
25 | elevation18,
26 | elevation19,
27 | elevation20,
28 | elevation21,
29 | elevation22,
30 | elevation23,
31 | elevation24
32 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/popover/enums/PopoverOriginHorizontal.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.popover.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class PopoverOriginHorizontal {
5 | left, center, right
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/popover/enums/PopoverOriginVertical.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.popover.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class PopoverOriginVertical {
5 | top, center, bottom
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/popover/enums/PopoverReference.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.popover.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class PopoverReference {
5 | anchorEl, anchorPosition, none
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/popover/enums/PopoverStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.popover.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class PopoverStyle {
5 | paper
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/popper/enums/PopperPlacement.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.popper.enums
2 |
3 | import kotlinx.html.AttributeEnum
4 |
5 | @Suppress("EnumEntryName")
6 | enum class PopperPlacement(override val realValue: String) : AttributeEnum {
7 | bottomEnd("bottom-end"),
8 | bottomStart("bottom-start"),
9 | bottom("bottom"),
10 | leftEnd("left-end"),
11 | leftStart("left-start"),
12 | left("left"),
13 | rightEnd("right-end"),
14 | rightStart("right-start"),
15 | right("right"),
16 | topEnd("top-end"),
17 | topStart("top-start"),
18 | top("top");
19 |
20 | override fun toString(): String = realValue
21 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/portal/PortalElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.portal
2 |
3 | import kotlinext.js.jsObject
4 | import org.w3c.dom.HTMLElement
5 | import org.w3c.dom.Node
6 | import react.*
7 |
8 | class PortalElementBuilder internal constructor(
9 | val type: ComponentType,
10 | private val props: PortalProps = jsObject { }
11 | ) : RBuilderImpl() {
12 | fun attrs(handler: PortalProps.() -> Unit) {
13 | props.handler()
14 | }
15 |
16 | fun create() = createElement(type, props, *childList.toTypedArray())
17 |
18 | fun PortalProps.container(node: Node) { props.container = node }
19 | fun PortalProps.container(htmlElement: HTMLElement) { props.container = htmlElement }
20 | fun PortalProps.container(block: RBuilder.() -> Unit) { props.container = buildElement(block) }
21 | fun PortalProps.onRendered(block: () -> Unit) { props.onRendered = block }
22 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/portal/portal.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.portal
2 |
3 | import materialui.Portal
4 | import react.RBuilder
5 | import react.PropsWithChildren
6 |
7 | external interface PortalProps : PropsWithChildren {
8 | var container: dynamic
9 | var disablePortal: Boolean?
10 | var onRendered: (() -> Unit)?
11 | }
12 |
13 | fun RBuilder.portal(block: PortalElementBuilder.() -> Unit) {
14 | child(PortalElementBuilder(Portal).apply(block).create())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/radio/enums/RadioColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.radio.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class RadioColor {
5 | primary, secondary, default
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/radio/enums/RadioStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.radio.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class RadioStyle {
5 | root,
6 | checked,
7 | disabled,
8 | colorPrimary,
9 | colorSecondary,
10 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/radio/radio.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.radio
2 |
3 | import materialui.Radio
4 | import materialui.components.internal.SwitchBaseProps
5 | import materialui.components.radio.enums.RadioStyle
6 | import react.RBuilder
7 |
8 | external interface RadioProps : SwitchBaseProps {
9 | var color: String?
10 | }
11 |
12 | fun RBuilder.radio(vararg classMap: Pair, block: RadioElementBuilder.() -> Unit) {
13 | child(RadioElementBuilder(Radio, classMap.toList()).apply(block).create())
14 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/radiogroup/radioGroup.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.radiogroup
2 |
3 | import materialui.RadioGroup
4 | import materialui.components.formgroup.FormGroupProps
5 | import react.RBuilder
6 |
7 | external interface RadioGroupProps : FormGroupProps {
8 | var defaultValue: Any?
9 | var name: String?
10 | var value: Any?
11 | }
12 |
13 | fun RBuilder.radioGroup(block: RadioGroupElementBuilder.() -> Unit) {
14 | child(RadioGroupElementBuilder(RadioGroup, listOf()).apply(block).create())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/rootref/RootRefElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.rootref
2 |
3 | import kotlinext.js.jsObject
4 | import react.*
5 |
6 | class RootRefElementBuilder internal constructor(
7 | val type: ComponentType,
8 | private val props: RootRefProps = jsObject { }
9 | ) : RBuilderImpl() {
10 | fun attrs(handler: RootRefProps.() -> Unit) {
11 | props.handler()
12 | }
13 |
14 | fun create() = createElement(type, props, *childList.toTypedArray())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/rootref/rootRef.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.rootref
2 |
3 | import materialui.RootRef
4 | import react.*
5 |
6 | external interface RootRefProps : PropsWithChildren {
7 | var rootRef: Ref<*>?
8 | }
9 |
10 | fun RBuilder.rootRef(block: RootRefElementBuilder.() -> Unit) {
11 | child(RootRefElementBuilder(RootRef).apply(block).create())
12 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/select/enums/SelectStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.select.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SelectStyle {
5 | root,
6 | select,
7 | filled,
8 | outlined,
9 | selectMenu,
10 | disabled,
11 | icon
12 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/select/enums/SelectVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.select.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SelectVariant {
5 | standard, outlined, filled
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slide/SlideElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slide
2 |
3 | import kotlinext.js.js
4 | import kotlinext.js.jsObject
5 | import materialui.components.slide.enums.SlideDirection
6 | import materialui.reacttransiton.RTransitionBuilder
7 | import materialui.reacttransiton.getValue
8 | import materialui.reacttransiton.setValue
9 | import react.ComponentType
10 |
11 | class SlideElementBuilder internal constructor(
12 | type: ComponentType
13 | ) : RTransitionBuilder(type, jsObject { }) {
14 | var SlideProps.direction: SlideDirection by props
15 |
16 | fun SlideProps.timeout(msec: Long) { timeout = msec }
17 | fun SlideProps.timeout(enter: Long? = null, exit: Long? = null) { timeout = js { this["enter"] = enter; this["exit"] = exit } }
18 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slide/enums/SlideDirection.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slide.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SlideDirection {
5 | left, right, up, down
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slide/slide.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slide
2 |
3 | import materialui.Slide
4 | import materialui.reacttransiton.RTransitionProps
5 | import materialui.styles.muitheme.MuiTheme
6 | import react.RBuilder
7 | import react.PropsWithChildren
8 |
9 | external interface SlideProps : RTransitionProps, PropsWithChildren {
10 | var style: Any?
11 | var theme: MuiTheme?
12 | }
13 |
14 | fun RBuilder.slide(block: SlideElementBuilder.() -> Unit) {
15 | child(SlideElementBuilder(Slide).apply(block).create())
16 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slider/enums/SliderColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slider.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SliderColor {
5 | primary, secondary
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slider/enums/SliderOrientation.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slider.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SliderOrientation {
5 | horizontal, vertical
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slider/enums/SliderStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slider.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SliderStyle {
5 | root,
6 | colorPrimary,
7 | colorSecondary,
8 | marked,
9 | vertical,
10 | disabled,
11 | rail,
12 | track,
13 | trackFalse,
14 | trackInverted,
15 | thumb,
16 | thumbColorPrimary,
17 | thumbColorSecondary,
18 | active,
19 | focusVisible,
20 | valueLabel,
21 | mark,
22 | markActive,
23 | markLabel,
24 | markLabelActive
25 | }
26 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slider/enums/SliderTrack.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slider.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SliderTrack {
5 | normal, inverted, `false`
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/slider/enums/SliderValueLabelDisplay.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.slider.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SliderValueLabelDisplay {
5 | on, auto, off
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/snackbar/enums/SnackbarOriginHorizontal.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.snackbar.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SnackbarOriginHorizontal {
5 | left, center, right
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/snackbar/enums/SnackbarOriginVertical.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.snackbar.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SnackbarOriginVertical {
5 | top, bottom
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/snackbar/enums/SnackbarStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.snackbar.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SnackbarStyle {
5 | root,
6 | anchorOriginTopCenter,
7 | anchorOriginBottomCenter,
8 | anchorOriginTopRight,
9 | anchorOriginBottomRight,
10 | anchorOriginTopLeft,
11 | anchorOriginBottomLeft
12 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/snackbarcontent/SnackbarContentElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.snackbarcontent
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.getValue
6 | import materialui.components.paper.PaperElementBuilder
7 | import materialui.components.setValue
8 | import react.*
9 |
10 | class SnackbarContentElementBuilder internal constructor(
11 | type: ComponentType,
12 | classMap: List, String>>,
13 | factory: (TagConsumer) -> T
14 | ) : PaperElementBuilder(type, classMap, factory) {
15 |
16 | var Tag.action: ReactElement? by materialProps
17 | var Tag.message: ReactElement? by materialProps
18 |
19 | fun Tag.action(block: RBuilder.() -> Unit) { action = buildElement(block) }
20 | fun Tag.message(block: RBuilder.() -> Unit) { message = buildElement(block) }
21 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/snackbarcontent/enums/SnackbarContentStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.snackbarcontent.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SnackbarContentStyle {
5 | root,
6 | message,
7 | action
8 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/step/enums/StepOrientation.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.step.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepOrientation {
5 | horizontal, vertical
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/step/enums/StepStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.step.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepStyle {
5 | root,
6 | horizontal,
7 | vertical,
8 | alternativeLabel,
9 | completed
10 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/step/step.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.step
2 |
3 | import materialui.Step
4 | import materialui.components.StandardProps
5 | import materialui.components.step.enums.StepStyle
6 | import react.RBuilder
7 | import react.ReactElement
8 |
9 | external interface StepProps : StandardProps {
10 | var active: Boolean?
11 | var alternativeLabel: Boolean?
12 | var completed: Boolean?
13 | var connector: ReactElement?
14 | var disabled: Boolean?
15 | var index: Number?
16 | var last: Boolean?
17 | var orientation: String?
18 | }
19 |
20 | fun RBuilder.step(vararg classMap: Pair, block: StepElementBuilder.() -> Unit) {
21 | child(StepElementBuilder(Step, classMap.toList()).apply(block).create())
22 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepbutton/enums/StepButtonStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepbutton.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepButtonStyle {
5 | root,
6 | horizontal,
7 | vertical,
8 | touchRipple
9 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepconnector/enums/StepConnectorStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepconnector.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepConnectorStyle {
5 | root,
6 | horizontal,
7 | vertical,
8 | alternativeLabel,
9 | active,
10 | completed,
11 | disabled,
12 | line,
13 | lineHorizontal,
14 | lineVertical
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepconnector/stepConnector.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepconnector
2 |
3 | import materialui.StepConnector
4 | import materialui.components.StandardProps
5 | import materialui.components.stepconnector.enums.StepConnectorStyle
6 | import react.RBuilder
7 |
8 | external interface StepConnectorProps : StandardProps {
9 | var active: Boolean?
10 | var alternativeLabel: Boolean?
11 | var completed: Boolean?
12 | var disabled: Boolean?
13 | var index: Number?
14 | var orientation: String?
15 | }
16 |
17 | fun RBuilder.stepConnector(vararg classMap: Pair, block: StepConnectorElementBuilder.() -> Unit) {
18 | child(StepConnectorElementBuilder(StepConnector, classMap.toList()).apply(block).create())
19 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepcontent/enums/StepContentStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepcontent.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepContentStyle {
5 | root,
6 | last,
7 | transition
8 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepcontent/stepContent.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepcontent
2 |
3 | import materialui.StepContent
4 | import materialui.components.StandardProps
5 | import materialui.components.stepcontent.enums.StepContentStyle
6 | import materialui.reacttransiton.RTransitionProps
7 | import react.RBuilder
8 |
9 | external interface StepContentProps : StandardProps {
10 | var active: Boolean?
11 | var alternativeLabel: Boolean?
12 | var completed: Boolean?
13 | var last: Boolean?
14 | var optional: Boolean?
15 | var orientation: String?
16 | var TransitionComponent: dynamic
17 | var transitionDuration: dynamic
18 | var TransitionProps: RTransitionProps?
19 | }
20 |
21 | fun RBuilder.stepContent(vararg classMap: Pair, block: StepContentElementBuilder.() -> Unit) {
22 | child(StepContentElementBuilder(StepContent, classMap.toList()).apply(block).create())
23 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepicon/enums/StepIconStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepicon.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepIconStyle {
5 | root,
6 | text,
7 | active,
8 | completed,
9 | error
10 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepicon/stepIcon.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepicon
2 |
3 | import materialui.StepIcon
4 | import materialui.components.StandardProps
5 | import materialui.components.stepicon.enums.StepIconStyle
6 | import react.RBuilder
7 | import react.ReactElement
8 |
9 | external interface StepIconProps : StandardProps {
10 | var active: Boolean?
11 | var completed: Boolean?
12 | var error: Boolean?
13 | var icon: ReactElement?
14 | }
15 |
16 | fun RBuilder.stepIcon(vararg classMap: Pair, block: StepIconElementBuilder.() -> Unit) {
17 | child(StepIconElementBuilder(StepIcon, classMap.toList()).apply(block).create())
18 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/steplabel/enums/StepLabelStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.steplabel.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepLabelStyle {
5 | root,
6 | horizontal,
7 | vertical,
8 | label,
9 | active,
10 | completed,
11 | error,
12 | disabled,
13 | iconContainer,
14 | alternativeLabel,
15 | labelContainer
16 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/stepper/enums/StepperStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.stepper.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class StepperStyle {
5 | root,
6 | horizontal,
7 | vertical,
8 | alternativeLabel
9 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/svgicon/enums/SvgIconColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.svgicon.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SvgIconColor {
5 | inherit, primary, secondary, action, error, disabled
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/svgicon/enums/SvgIconFontSize.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.svgicon.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SvgIconFontSize {
5 | inherit, default, small, large
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/svgicon/enums/SvgIconStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.svgicon.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SvgIconStyle {
5 | root,
6 | colorPrimary,
7 | colorSecondary,
8 | colorAction,
9 | colorError,
10 | colorDisabled,
11 | fontSizeInherit,
12 | fontSizeSmall,
13 | fontSizeLarge
14 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/swipeabledrawer/swipeableDrawer.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.swipeabledrawer
2 |
3 | import materialui.SwipeableDrawer
4 | import materialui.components.drawer.DrawerProps
5 | import org.w3c.dom.events.Event
6 | import react.RBuilder
7 | import react.PropsWithChildren
8 |
9 | external interface SwipeableDrawerProps : DrawerProps {
10 | var disableBackdropTransition: Boolean?
11 | var disableDiscovery: Boolean?
12 | var disableSwipeToOpen: Boolean?
13 | var hideBackdrop: Boolean?
14 | var hysteresis: Number?
15 | var minFlingVelocity: Number?
16 | var onOpen: ((Event) -> Unit)?
17 | var SwipeAreaProps: PropsWithChildren?
18 | var swipeAreaWidth: Number?
19 | }
20 |
21 | fun RBuilder.swipeableDrawer(block: SwipeableDrawerElementBuilder.() -> Unit) {
22 | child(SwipeableDrawerElementBuilder(SwipeableDrawer, listOf()).apply(block).create())
23 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/switches/enums/SwitchColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.switches.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SwitchColor {
5 | primary, secondary, default
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/switches/enums/SwitchStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.switches.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class SwitchStyle {
5 | root,
6 | checked,
7 | disabled,
8 | input,
9 | switchBase,
10 | colorPrimary,
11 | colorSecondary,
12 | sizeSmall,
13 | thumb,
14 | track,
15 | }
16 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/switches/switch.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.switches
2 |
3 | import materialui.Switch
4 | import materialui.components.internal.SwitchBaseProps
5 | import materialui.components.switches.enums.SwitchStyle
6 | import react.RBuilder
7 |
8 | external interface SwitchProps : SwitchBaseProps {
9 | var color: String?
10 | }
11 |
12 | fun RBuilder.switch(vararg classMap: Pair, block: SwitchElementBuilder.() -> Unit) {
13 | child(SwitchElementBuilder(Switch, classMap.toList()).apply(block).create())
14 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tab/enums/TabStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tab.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabStyle {
5 | root,
6 | labelIcon,
7 | textColorInherit,
8 | textColorPrimary,
9 | textColorSecondary,
10 | selected,
11 | disabled,
12 | fullWidth,
13 | wrapper,
14 | labelContainer,
15 | label,
16 | labelWrapped
17 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tab/enums/TabTextColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tab.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabTextColor {
5 | secondary, primary, inherit
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/table/TableElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.table
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import materialui.components.getValue
7 | import materialui.components.setValue
8 | import materialui.components.table.enums.TablePadding
9 | import react.ComponentType
10 |
11 | class TableElementBuilder internal constructor(
12 | type: ComponentType,
13 | classMap: List, String>>,
14 | factory: (TagConsumer) -> T
15 | ) : MaterialElementBuilder(type, classMap, factory) {
16 |
17 | var Tag.padding: TablePadding? by materialProps
18 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/table/enums/TablePadding.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.table.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TablePadding {
5 | default, checkbox, dense, none
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablebody/TableBodyElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablebody
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import react.ComponentType
7 |
8 | class TableBodyElementBuilder internal constructor(
9 | type: ComponentType,
10 | classMap: List, String>>,
11 | factory: (TagConsumer) -> T
12 | ) : MaterialElementBuilder(type, classMap, factory)
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablebody/tableBody.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablebody
2 |
3 | import kotlinx.html.TBODY
4 | import kotlinx.html.Tag
5 | import kotlinx.html.TagConsumer
6 | import materialui.TableBody
7 | import materialui.components.MaterialStyle
8 | import materialui.components.StandardProps
9 | import react.RBuilder
10 |
11 | external interface TableBodyProps : StandardProps
12 |
13 | fun RBuilder.tableBody(rootStyle: String? = null, block: TableBodyElementBuilder.() -> Unit) {
14 | child(TableBodyElementBuilder(TableBody, listOfNotNull(rootStyle?.let { MaterialStyle.root to it })) { TBODY(mapOf(), it) }.apply(block).create())
15 | }
16 | fun RBuilder.tableBody(rootStyle: String? = null, factory: (TagConsumer) -> T, block: TableBodyElementBuilder.() -> Unit) {
17 | child(TableBodyElementBuilder(TableBody, listOfNotNull(rootStyle?.let { MaterialStyle.root to it }), factory).apply(block).create())
18 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellAlign.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellAlign {
5 | inherit, left, center, right, justify
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellPadding.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellPadding {
5 | default, checkbox, none
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellSize.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellSize {
5 | small, medium
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellSortDirection.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellSortDirection(internal val value: Any) {
5 | asc("asc"),
6 | desc("desc"),
7 | `false`(false)
8 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellStyle {
5 | root,
6 | head,
7 | body,
8 | footer,
9 | numeric,
10 | paddingDense,
11 | paddingCheckbox,
12 | paddingNone,
13 | alignLeft,
14 | alignCenter,
15 | alignRight,
16 | alignJustify
17 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablecell/enums/TableCellVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablecell.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableCellVariant {
5 | head, body, footer
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablefooter/TableFooterElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablefooter
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import react.ComponentType
7 |
8 | class TableFooterElementBuilder internal constructor(
9 | type: ComponentType,
10 | classMap: List, String>>,
11 | factory: (TagConsumer) -> T
12 | ) : MaterialElementBuilder(type, classMap, factory)
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablehead/TableHeadElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablehead
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import react.ComponentType
7 |
8 | class TableHeadElementBuilder internal constructor(
9 | type: ComponentType,
10 | classMap: List, String>>,
11 | factory: (TagConsumer) -> T
12 | ) : MaterialElementBuilder(type, classMap, factory)
13 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablehead/tableHead.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablehead
2 |
3 | import kotlinx.html.THEAD
4 | import kotlinx.html.Tag
5 | import kotlinx.html.TagConsumer
6 | import materialui.TableHead
7 | import materialui.components.MaterialStyle
8 | import materialui.components.StandardProps
9 | import react.*
10 |
11 | external interface TableHeadProps : StandardProps
12 |
13 | fun RBuilder.tableHead(rootStyle: String? = null, block: TableHeadElementBuilder.() -> Unit) {
14 | child(TableHeadElementBuilder(TableHead, listOfNotNull(rootStyle?.let { MaterialStyle.root to it })) { THEAD(mapOf(), it) }.apply(block).create())
15 | }
16 | fun RBuilder.tableHead(rootStyle: String? = null, factory: (TagConsumer) -> T, block: TableHeadElementBuilder.() -> Unit) {
17 | child(TableHeadElementBuilder(TableHead, listOfNotNull(rootStyle?.let { MaterialStyle.root to it }), factory).apply(block).create())
18 | }
19 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablepagination/enums/TablePaginationStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablepagination.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TablePaginationStyle {
5 | root,
6 | toolbar,
7 | spacer,
8 | caption,
9 | selectRoot,
10 | select,
11 | selectIcon,
12 | input,
13 | menuItem,
14 | actions
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablerow/TableRowElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablerow
2 |
3 | import kotlinx.html.Tag
4 | import kotlinx.html.TagConsumer
5 | import materialui.components.MaterialElementBuilder
6 | import materialui.components.getValue
7 | import materialui.components.setValue
8 | import materialui.components.tablerow.enums.TableRowStyle
9 | import react.ComponentType
10 |
11 | class TableRowElementBuilder internal constructor(
12 | type: ComponentType,
13 | classMap: List, String>>,
14 | factory: (TagConsumer) -> T
15 | ) : MaterialElementBuilder(type, classMap, factory) {
16 | fun Tag.classes(vararg classMap: Pair) {
17 | classes(classMap.toList())
18 | }
19 |
20 | var Tag.hover: Boolean? by materialProps
21 | var Tag.selected: Boolean? by materialProps
22 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablerow/enums/TableRowStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablerow.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableRowStyle {
5 | root,
6 | selected,
7 | hover,
8 | head,
9 | footer
10 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tablesortlabel/enums/TableSortLabelDirection.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tablesortlabel.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TableSortLabelDirection {
5 | asc, desc
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/TabIndicatorElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs
2 |
3 | import kotlinx.css.CssBuilder
4 | import kotlinx.css.RuleSet
5 | import kotlinx.html.SPAN
6 | import kotlinx.html.Tag
7 | import materialui.components.tabs.enums.TabsIndicatorColor
8 | import materialui.styles.toDynamic
9 | import react.dom.RDOMBuilderImpl
10 | import react.dom.setProp
11 |
12 | class TabIndicatorElementBuilder internal constructor() : RDOMBuilderImpl({ SPAN(mapOf(), it) }) {
13 | var Tag.color: TabsIndicatorColor?
14 | get() = (asDynamic()["color"] as String?)?.let { TabsIndicatorColor.valueOf(it) }
15 | set(value) { asDynamic()["color"] = value?.toString() }
16 |
17 | fun style(ruleSet: RuleSet) {
18 | setProp("style", CssBuilder().apply(ruleSet).toDynamic)
19 | }
20 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/enums/TabsIndicatorColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabsIndicatorColor {
5 | secondary, primary
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/enums/TabsScrollButtons.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabsScrollButtons {
5 | auto, on, off
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/enums/TabsStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabsStyle {
5 | root,
6 | flexContainer,
7 | centered,
8 | scroller,
9 | fixed,
10 | scrollable,
11 | scrollButtons,
12 | scrollButtonsAuto,
13 | indicator
14 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/enums/TabsTextColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabsTextColor {
5 | secondary, primary, inherit
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/enums/TabsVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TabsVariant {
5 | standard, scrollable, fullWidth
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tabs/tabIndicator.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tabs
2 |
3 | internal fun tabIndicatorElement(
4 | block: TabIndicatorElementBuilder.() -> Unit
5 | ) = TabIndicatorElementBuilder().apply(block).create()
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/textfield/enums/TextFieldSize.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.textfield.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TextFieldSize{
5 | small,medium
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/toolbar/enums/ToolbarStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.toolbar.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ToolbarStyle {
5 | root,
6 | gutters,
7 | regular,
8 | dense
9 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/toolbar/enums/ToolbarVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.toolbar.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class ToolbarVariant {
5 | regular, dense
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/toolbar/toolbar.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.toolbar
2 |
3 | import kotlinx.html.DIV
4 | import kotlinx.html.Tag
5 | import kotlinx.html.TagConsumer
6 | import materialui.Toolbar
7 | import materialui.components.StandardProps
8 | import materialui.components.toolbar.enums.ToolbarStyle
9 | import react.*
10 |
11 | external interface ToolbarProps : StandardProps {
12 | var disableGutters: Boolean?
13 | var variant: String?
14 | }
15 |
16 | fun RBuilder.toolbar(vararg classMap: Pair, block: ToolbarElementBuilder.() -> Unit) {
17 | child(ToolbarElementBuilder(Toolbar, classMap.toList()) { DIV(mapOf(), it) }.apply(block).create())
18 | }
19 | fun
RBuilder.toolbar(vararg classMap: Pair, factory: (TagConsumer) -> T, block: ToolbarElementBuilder.() -> Unit) {
20 | child(ToolbarElementBuilder(Toolbar, classMap.toList(), factory).apply(block).create())
21 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tooltip/enums/TooltipPlacement.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tooltip.enums
2 |
3 | import kotlinx.html.AttributeEnum
4 |
5 | @Suppress("EnumEntryName")
6 | enum class TooltipPlacement(override val realValue: String) : AttributeEnum {
7 | bottomEnd("bottom-end"),
8 | bottomStart("bottom-start"),
9 | bottom("bottom"),
10 | leftEnd("left-end"),
11 | leftStart("left-start"),
12 | left("left"),
13 | rightEnd("right-end"),
14 | rightStart("right-start"),
15 | right("right"),
16 | topEnd("top-end"),
17 | topStart("top-start"),
18 | top("top");
19 |
20 | override fun toString(): String = realValue
21 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/tooltip/enums/TooltipStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.tooltip.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TooltipStyle {
5 | popper,
6 | popperInteractive,
7 | tooltip,
8 | touch,
9 | tooltipPlacementLeft,
10 | tooltipPlacementRight,
11 | tooltipPlacementTop,
12 | tooltipPlacementBottom
13 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/typography/enums/TypographyAlign.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.typography.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TypographyAlign {
5 | inherit, left, center, right, justify
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/typography/enums/TypographyColor.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.typography.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TypographyColor {
5 | initial, inherit, primary, secondary, textPrimary, textSecondary, error
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/typography/enums/TypographyDisplay.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.typography.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TypographyDisplay {
5 | initial, block, inline
6 | }
7 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/typography/enums/TypographyStyle.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.typography.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TypographyStyle {
5 | root,
6 | body2,
7 | body1,
8 | caption,
9 | button,
10 | h1,
11 | h2,
12 | h3,
13 | h4,
14 | h5,
15 | h6,
16 | subtitle1,
17 | subtitle2,
18 | overline,
19 | srOnly,
20 | alignLeft,
21 | alignCenter,
22 | alignRight,
23 | alignJustify,
24 | noWrap,
25 | gutterBottom,
26 | paragraph,
27 | colorInherit,
28 | colorPrimary,
29 | colorSecondary,
30 | colorTextPrimary,
31 | colorTextSecondary,
32 | colorError,
33 | displayInline,
34 | displayBlock,
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/typography/enums/TypographyVariant.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.typography.enums
2 |
3 | @Suppress("EnumEntryName")
4 | enum class TypographyVariant {
5 | h1,
6 | h2,
7 | h3,
8 | h4,
9 | h5,
10 | h6,
11 | subtitle1,
12 | subtitle2,
13 | body1,
14 | body2,
15 | caption,
16 | button,
17 | overline,
18 | srOnly,
19 | inherit
20 | }
21 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/zoom/ZoomElementBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.zoom
2 |
3 | import kotlinext.js.js
4 | import kotlinext.js.jsObject
5 | import materialui.reacttransiton.RTransitionBuilder
6 | import react.ComponentType
7 |
8 | class ZoomElementBuilder internal constructor(
9 | type: ComponentType
10 | ) : RTransitionBuilder(type, jsObject { }) {
11 |
12 | fun ZoomProps.timeout(msec: Long) { timeout = msec }
13 | fun ZoomProps.timeout(enter: Long? = null, exit: Long? = null) { timeout = js { this["enter"] = enter; this["exit"] = exit } }
14 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/components/zoom/zoom.kt:
--------------------------------------------------------------------------------
1 | package materialui.components.zoom
2 |
3 | import materialui.Zoom
4 | import materialui.reacttransiton.RTransitionProps
5 | import materialui.styles.muitheme.MuiTheme
6 | import react.RBuilder
7 | import react.PropsWithChildren
8 |
9 | external interface ZoomProps : RTransitionProps, PropsWithChildren {
10 | var style: Any?
11 | var theme: MuiTheme?
12 | }
13 |
14 | fun RBuilder.zoom(block: ZoomElementBuilder.() -> Unit) {
15 | child(ZoomElementBuilder(Zoom).apply(block).create())
16 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/reacteventlistener/REventListenerBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.reacteventlistener
2 |
3 | import kotlinext.js.jsObject
4 | import react.*
5 |
6 | abstract class REventListenerBuilder internal constructor(
7 | val type: ComponentType,
8 | protected val props: Props = jsObject { }
9 | ) : RBuilderImpl() {
10 | fun attrs(handler: Props.() -> Unit) {
11 | props.handler()
12 | }
13 |
14 | fun create() = createElement(type, props, *childList.toTypedArray())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/reacttransiton/RTransitionBuilder.kt:
--------------------------------------------------------------------------------
1 | package materialui.reacttransiton
2 |
3 | import kotlinext.js.jsObject
4 | import react.*
5 |
6 | abstract class RTransitionBuilder(
7 | protected val type: ComponentType,
8 | protected val props: P = jsObject { }
9 | ) : RBuilderImpl() {
10 | fun attrs(handler: P.() -> Unit) {
11 | props.handler()
12 | }
13 |
14 | fun create() = createElement(type, props, *childList.toTypedArray())
15 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/JssPreset.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles
2 |
3 | external interface JssOptions {
4 | var plugins: Array
5 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/breakpoint/Breakpoint.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles.breakpoint
2 |
3 | @Suppress("EnumEntryName")
4 | enum class Breakpoint {
5 | xs, sm, md, lg, xl
6 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/breakpoint/BreakpointValues.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles.breakpoint
2 |
3 | external interface BreakpointValues {
4 | val xs: Number
5 | val sm: Number
6 | val md: Number
7 | val lg: Number
8 | val xl: Number
9 | }
10 |
11 | operator fun BreakpointValues.get(key: Breakpoint): Number = when (key) {
12 | Breakpoint.xs -> xs
13 | Breakpoint.sm -> sm
14 | Breakpoint.md -> md
15 | Breakpoint.lg -> lg
16 | Breakpoint.xl -> xl
17 | }
18 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/breakpoint/options/BreakpointValuesOptions.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles.breakpoint.options
2 |
3 | import materialui.styles.breakpoint.Breakpoint
4 |
5 | external interface BreakpointValuesOptions {
6 | var xs: Number
7 | var sm: Number
8 | var md: Number
9 | var lg: Number
10 | var xl: Number
11 | }
12 |
13 | operator fun BreakpointValuesOptions.get(key: Breakpoint): Number = when (key) {
14 | Breakpoint.xs -> xs
15 | Breakpoint.sm -> sm
16 | Breakpoint.md -> md
17 | Breakpoint.lg -> lg
18 | Breakpoint.xl -> xl
19 | }
20 |
21 | operator fun BreakpointValuesOptions.set(key: Breakpoint, value: Number) {
22 | when (key) {
23 | Breakpoint.xs -> { xs = value }
24 | Breakpoint.sm -> { sm = value }
25 | Breakpoint.md -> { md = value }
26 | Breakpoint.lg -> { lg = value }
27 | Breakpoint.xl -> { xl = value }
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/createBreakpoints.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE")
2 |
3 | package materialui.styles
4 |
5 | import kotlinext.js.jsObject
6 | import materialui.rawCreateBreakpoints
7 | import materialui.styles.breakpoint.options.BreakpointsOptions
8 |
9 | fun createBreakpoints(handler: BreakpointsOptions.() -> Unit) = rawCreateBreakpoints(jsObject(handler))
10 | fun defaultBreakpoints() = createBreakpoints { }
11 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/createGenerateClassName.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles
2 |
3 | import kotlinext.js.jsObject
4 | import materialui.createGenerateClassName
5 | import materialui.styles.stylesprovider.GenerateId
6 |
7 | external interface GenerateClassNameOptions {
8 | var disableGlobal: Boolean?
9 | var productionPrefix: String?
10 | var seed: String?
11 | }
12 |
13 | fun createGenerateClassName(
14 | disableGlobal: Boolean? = null,
15 | productionPrefix: String? = null,
16 | seed: String? = null
17 | ): GenerateId{
18 | return createGenerateClassName(jsObject{
19 | disableGlobal?.let {this.disableGlobal = it }
20 | productionPrefix?.let { this.productionPrefix = it }
21 | seed?. let { this.seed = it }
22 | })
23 | }
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/createMuiTheme.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE")
2 |
3 | package materialui.styles
4 |
5 | import kotlinext.js.jsObject
6 | import materialui.rawCreateMuiTheme
7 | import materialui.styles.muitheme.options.MuiThemeOptions
8 |
9 | fun createMuiTheme(handler: MuiThemeOptions.() -> Unit) = rawCreateMuiTheme(jsObject { }.apply(handler))
10 |
11 | val defaultMuiTheme get() = createMuiTheme { }
12 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/createPalette.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE")
2 |
3 | package materialui.styles
4 |
5 | import kotlinext.js.jsObject
6 | import materialui.rawCreatePalette
7 | import materialui.styles.palette.options.PaletteOptions
8 |
9 | fun createPalette(handler: PaletteOptions.() -> Unit) = rawCreatePalette(jsObject(handler))
10 |
11 | fun defaultPalette() = createPalette { }
12 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/createTypography.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE")
2 |
3 | package materialui.styles
4 |
5 | import materialui.rawCreateTypography
6 | import materialui.styles.palette.Palette
7 | import materialui.styles.typography.Typography
8 |
9 | fun createTypography(palette: Palette, typography: Typography) = rawCreateTypography(palette, typography)
10 | fun createTypography(palette: Palette, typography: (Palette) -> Typography) = rawCreateTypography(palette, typography)
11 |
--------------------------------------------------------------------------------
/core/src/main/kotlin/materialui/styles/makeStyles.kt:
--------------------------------------------------------------------------------
1 | package materialui.styles
2 |
3 | import kotlinext.js.js
4 | import materialui.rawMakeStyles
5 | import materialui.styles.muitheme.MuiTheme
6 | import react.*
7 |
8 | @Suppress("UNCHECKED_CAST")
9 | fun