Skip to content

Commit

Permalink
Try to fix SpeedDial.ariaLabel mismatch with AriaAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
aerialist7 committed Dec 25, 2024
1 parent e649ad1 commit bf47334
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 78 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/karakum/mui/Overrides.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal fun fixOverrides(

"SpeedDial",
-> content
.override("ariaLabel").replace("override var ariaLabel: String", "override var ariaLabel: String?")
.override("ariaLabel").replace("override var ariaLabel: String", "/* override var ariaLabel: String */")
.override("hidden")

"Tab",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.html.HTMLElement

external interface TablePaginationProps :
TablePaginationOwnProps,
react.dom.html.HTMLAttributes<web.html.HTMLTableCellElement>
Expand Down Expand Up @@ -105,7 +103,7 @@ external interface TablePaginationOwnProps : react.Props {
*
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
*/
var onRowsPerPageChange: react.dom.events.ChangeEventHandler<HTMLElement>?
var onRowsPerPageChange: react.dom.events.ChangeEventHandler<web.html.HTMLElement>?

/**
* The zero-based index of the current page.
Expand Down
5 changes: 2 additions & 3 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useButton.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

package mui.base

import web.dom.Element
import web.html.ButtonType

external interface UseButtonParameters {
Expand All @@ -22,7 +21,7 @@ external interface UseButtonParameters {

var onFocusVisible: react.dom.events.FocusEventHandler<*>?

var rootRef: react.Ref<Element>?
var rootRef: react.Ref<web.dom.Element>?

var tabIndex: Int?

Expand Down Expand Up @@ -91,5 +90,5 @@ external interface UseButtonReturnValue {
/**
* A ref to the component's root DOM element.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?
}
14 changes: 6 additions & 8 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useInput.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.html.HTMLElement

external interface UseInputParameters {
/**
* The default value. Use when the component is not controlled.
Expand All @@ -22,13 +20,13 @@ external interface UseInputParameters {
*/
var error: Boolean?

var onBlur: react.dom.events.FocusEventHandler<HTMLElement>?
var onBlur: react.dom.events.FocusEventHandler<web.html.HTMLElement>?

var onClick: react.dom.events.MouseEventHandler<*>?

var onChange: react.dom.events.ChangeEventHandler<HTMLElement>?
var onChange: react.dom.events.ChangeEventHandler<web.html.HTMLElement>?

var onFocus: react.dom.events.FocusEventHandler<HTMLElement>?
var onFocus: react.dom.events.FocusEventHandler<web.html.HTMLElement>?

var inputRef: react.Ref<web.html.HTMLInputElement /* or web.html.HTMLTextAreaElement*/>?

Expand All @@ -52,11 +50,11 @@ external interface UseInputInputSlotOwnProps : react.Props {

var value: dynamic

var onBlur: react.dom.events.FocusEventHandler<HTMLElement>
var onBlur: react.dom.events.FocusEventHandler<web.html.HTMLElement>

var onChange: react.dom.events.ChangeEventHandler<HTMLElement>
var onChange: react.dom.events.ChangeEventHandler<web.html.HTMLElement>

var onFocus: react.dom.events.FocusEventHandler<HTMLElement>
var onFocus: react.dom.events.FocusEventHandler<web.html.HTMLElement>

var required: Boolean

Expand Down
5 changes: 2 additions & 3 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useList.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package mui.base

import js.array.ReadonlyArray
import web.dom.Element
import web.html.HTMLElement

external interface ListState<ItemValue> {
Expand Down Expand Up @@ -80,7 +79,7 @@ external interface UseListParameters<ItemValue, State, CustomAction, CustomActio
/**
* Ref to the list root DOM element.
*/
var rootRef: react.Ref<Element>?
var rootRef: react.Ref<web.dom.Element>?

/**
* Callback fired when the selected value changes.
Expand Down Expand Up @@ -193,7 +192,7 @@ external interface UseListReturnValue {
*/
var getRootProps: react.Props /* <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseListRootSlotProps<ExternalProps> */

var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?

var state: dynamic
}
8 changes: 3 additions & 5 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useMenu.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
package mui.base

import js.array.ReadonlyArray
import web.dom.Element
import web.html.HTMLElement

external interface UseMenuParameters {
/**
Expand Down Expand Up @@ -40,7 +38,7 @@ external interface UseMenuParameters {
/**
* The ref to the menu's listbox node.
*/
var listboxRef: react.Ref<Element>?
var listboxRef: react.Ref<web.dom.Element>?

/**
* The name of the component using useMenu.
Expand Down Expand Up @@ -77,7 +75,7 @@ external interface UseMenuReturnValue {
/**
* The ref to the menu's listbox node.
*/
var listboxRef: react.RefCallback<Element>?
var listboxRef: react.RefCallback<web.dom.Element>?

/**
* Items in the menu listbox.
Expand All @@ -92,5 +90,5 @@ external interface UseMenuReturnValue {
/**
* An element that triggers the visibility of the menu.
*/
var triggerElement: HTMLElement?
var triggerElement: web.html.HTMLElement?
}
7 changes: 2 additions & 5 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useMenuButton.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

package mui.base

import web.dom.Element
import web.html.HTMLElement

external interface UseMenuButtonParameters {
/**
* If `true`, the component is disabled.
Expand All @@ -21,7 +18,7 @@ external interface UseMenuButtonParameters {
/**
* The ref to the root element.
*/
var rootRef: react.Ref<HTMLElement>?
var rootRef: react.Ref<web.html.HTMLElement>?
}

external interface UseMenuButtonReturnValue {
Expand All @@ -42,5 +39,5 @@ external interface UseMenuButtonReturnValue {
/**
* The ref to the root element.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?
}
6 changes: 2 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useMenuItem.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.dom.Element

external interface MenuItemMetadata {
var id: String

Expand All @@ -21,7 +19,7 @@ external interface UseMenuItemParameters {

var onClick: react.dom.events.MouseEventHandler<*>?

var rootRef: react.Ref<Element>
var rootRef: react.Ref<web.dom.Element>

/**
* If `true`, the menu item won't receive focus when the mouse moves over it.
Expand Down Expand Up @@ -62,7 +60,7 @@ external interface UseMenuItemReturnValue {
/**
* The ref to the component's root DOM element.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?

/**
* Total number of items in the menu.
Expand Down
6 changes: 2 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useOption.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.dom.Element

external interface SelectOption<Value> {
var value: Value

Expand All @@ -21,7 +19,7 @@ external interface UseOptionParameters<Value> {

var label: react.ReactNode

var rootRef: react.Ref<Element>?
var rootRef: react.Ref<web.dom.Element>?

var value: Value
}
Expand Down Expand Up @@ -49,5 +47,5 @@ external interface UseOptionReturnValue {
/**
* Ref to the root slot DOM node.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?
}
10 changes: 4 additions & 6 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useSelect.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.dom.Element

external interface SelectOptionDefinition<Value> {
var value: Value

Expand Down Expand Up @@ -42,7 +40,7 @@ external interface UseSelectParameters<OptionValue, Multiple> {
/**
* The ref of the trigger button element.
*/
var buttonRef: react.Ref<Element>?
var buttonRef: react.Ref<web.dom.Element>?

/**
* The `id` attribute of the listbox element.
Expand All @@ -52,7 +50,7 @@ external interface UseSelectParameters<OptionValue, Multiple> {
/**
* The ref of the listbox element.
*/
var listboxRef: react.Ref<Element>?
var listboxRef: react.Ref<web.dom.Element>?

/**
* If `true`, the end user can select multiple values.
Expand Down Expand Up @@ -145,7 +143,7 @@ external interface UseSelectReturnValue<Value, Multiple> {
/**
* Ref to the button slot DOM node.
*/
var buttonRef: react.RefCallback<Element>?
var buttonRef: react.RefCallback<web.dom.Element>?

/**
* If `true`, the select is disabled.
Expand Down Expand Up @@ -200,7 +198,7 @@ external interface UseSelectReturnValue<Value, Multiple> {
/**
* Ref to the listbox slot DOM node.
*/
var listboxRef: react.RefCallback<Element>?
var listboxRef: react.RefCallback<web.dom.Element>?

/**
* If `true`, the listbox is open.
Expand Down
5 changes: 2 additions & 3 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useSlider.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package mui.base

import js.array.ReadonlyArray
import web.dom.Element
import web.events.Event

external interface UseSliderParameters {
Expand Down Expand Up @@ -90,7 +89,7 @@ external interface UseSliderParameters {
/**
* The ref attached to the root of the Slider.
*/
var rootRef: react.Ref<Element>?
var rootRef: react.Ref<web.dom.Element>?

/**
* A transformation function, to change the scale of the slider.
Expand Down Expand Up @@ -208,7 +207,7 @@ external interface UseSliderReturnValue {
/**
* Ref to the root slot's DOM node.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?

/**
* The track leap for the current value of the slider.
Expand Down
6 changes: 2 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useTab.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.dom.Element

external interface UseTabParameters {
/**
* The value of the tab.
Expand Down Expand Up @@ -36,7 +34,7 @@ external interface UseTabParameters {
/**
* Ref to the root slot's DOM element.
*/
var rootRef: react.Ref<Element>?
var rootRef: react.Ref<web.dom.Element>?
}

external interface UseTabReturnValue {
Expand Down Expand Up @@ -71,7 +69,7 @@ external interface UseTabReturnValue {
/**
* Ref to the root slot's DOM element.
*/
var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?

/**
* If `true`, the tab is selected.
Expand Down
6 changes: 2 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useTabPanel.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package mui.base

import web.html.HTMLElement

external interface UseTabPanelParameters {
/**
* The id of the TabPanel.
Expand All @@ -13,7 +11,7 @@ external interface UseTabPanelParameters {
/**
* The ref of the TabPanel.
*/
var rootRef: react.Ref<HTMLElement>?
var rootRef: react.Ref<web.html.HTMLElement>?

/**
* The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected.
Expand All @@ -34,5 +32,5 @@ external interface UseTabPanelReturnValue {
*/
var getRootProps: react.Props /* <ExternalProps extends Record<string, unknown> = {}>(externalProps?: ExternalProps) => UseTabPanelRootSlotProps<ExternalProps> */

var rootRef: react.Ref<HTMLElement>
var rootRef: react.Ref<web.html.HTMLElement>
}
6 changes: 2 additions & 4 deletions mui-kotlin/src/jsMain/kotlin/mui/base/useTabsList.types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

package mui.base

import web.dom.Element

external interface UseTabsListParameters {
/**
* Ref to the root element.
*/
var rootRef: react.Ref<Element>
var rootRef: react.Ref<web.dom.Element>
}

external interface UseTabsListReturnValue {
Expand Down Expand Up @@ -45,7 +43,7 @@ external interface UseTabsListReturnValue {
*/
var orientation: Orientation

var rootRef: react.RefCallback<Element>?
var rootRef: react.RefCallback<web.dom.Element>?

/**
* The value of the currently selected tab.
Expand Down
3 changes: 1 addition & 2 deletions mui-kotlin/src/jsMain/kotlin/mui/material/Pagination.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ package mui.material

import mui.material.styles.Theme
import mui.system.SxProps
import web.html.HTMLElement

external interface PaginationProps :
UsePaginationProps,
mui.system.StandardProps,
react.dom.html.HTMLAttributes<HTMLElement>,
react.dom.html.HTMLAttributes<web.html.HTMLElement>,
mui.system.PropsWithSx {
/**
* Override or extend the styles applied to the component.
Expand Down
2 changes: 1 addition & 1 deletion mui-kotlin/src/jsMain/kotlin/mui/material/SpeedDial.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ external interface SpeedDialProps :
* The aria-label of the button element.
* Also used to provide the `id` for the `SpeedDial` element and its children.
*/
override var ariaLabel: String?
/* override var ariaLabel: String */

/**
* The direction the actions open relative to the floating action button.
Expand Down
Loading

0 comments on commit bf47334

Please sign in to comment.