Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/src/examples/ExampleAutocomplete.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/src/examples/ExampleAutocomplete.res
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ let make = () => {
fullWidth=true
renderInput={params => {
let props = params->Mui.Autocomplete.renderInputParamsToTextFieldProps
<Mui.TextField
{...props} label={React.string({"Combo box (uncontrolled)"})} variant=Outlined
<Mui.TextField
{...props} maxLength={20} label={React.string({"Combo box (uncontrolled)"})} variant=Outlined
/>
}}
/>
Expand Down
6 changes: 3 additions & 3 deletions examples/src/examples/ExampleSlider.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/src/examples/ExampleTextFieldSize.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions examples/src/examples/Examples.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions examples/src/examples/Examples.res
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,29 @@ let make = () => <>
<Divider />
<br />
<br />
<Grid container=true alignItems=String("center")>
<Grid item=true md=Number(6)>
<Typography variant=H5> {"Input textarea"->React.string} </Typography>
</Grid>
<Grid item=true md=Number(6)>
<Input multiline=true rows=80 minLength=1 maxLength=1_000 wrap=Soft />
<TextField
minLength=1
maxLength=1_000
wrap=Soft
multiline=true
rows=80
onChange={_event => ()}
onBlur={_event => ()}
onFocus={_event => ()}
/>
</Grid>
</Grid>
<br />
<br />
<Divider />
<br />
<br />
<Grid container=true alignItems=String("center")>
<Grid item=true md=Number(6)>
<Typography variant=H5> {"Component Override"->React.string} </Typography>
Expand Down
1 change: 1 addition & 0 deletions packages/rescript-mui-lab/src/TreeItem.res
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type classes = {
}

type props = {
...Mui.CommonProps.t,
...Mui.CommonProps.clickablePropsWithOnClick,
/**
* The id of the node.
Expand Down
5 changes: 0 additions & 5 deletions packages/rescript-mui-material/src/components/Alert.res
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ type props = {
* @param {React.SyntheticEvent} event The event source of the callback.
*/
onClose?: ReactEvent.Synthetic.t => unit,
/**
* The ARIA role attribute of the element.
* @default 'alert'
*/
role?: string,
/**
* The severity of the alert. This defines the color and icon used.
* @default 'success'
Expand Down
3 changes: 2 additions & 1 deletion packages/rescript-mui-material/src/components/ButtonBase.res
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ type type_ =
| String(string)

type publicProps = {
...CommonProps.clickableProps,
...CommonProps.t_NoId,
...CommonProps.eventHandlerProps,
/**
* A ref for imperative actions.
* It currently only supports `focusVisible()` action.
Expand Down
1 change: 0 additions & 1 deletion packages/rescript-mui-material/src/components/Checkbox.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type edge =

type props<'value> = {
...ButtonBase.publicPropsWithOnClick,
autoFocus?: bool,
/**
* If `true`, the component is checked.
*/
Expand Down
1 change: 0 additions & 1 deletion packages/rescript-mui-material/src/components/Divider.res
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ type props = {
* @default 'fullWidth'
*/
variant?: variant,
role?: string,
}

@module("@mui/material/Divider")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type variant =
| @as("filled") Filled

type publicProps = {
...CommonProps.t_NoId,
/**
* The component used for the root node. Either a string to use a HTML element or a component.
*/
Expand All @@ -60,6 +59,7 @@ type publicProps = {
}

type props = {
...CommonProps.t_NoId,
...publicProps,
/**
* The content of the component.
Expand Down
55 changes: 16 additions & 39 deletions packages/rescript-mui-material/src/components/InputBase.res
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,11 @@ type color =
| @as("warning") Warning
| String(string)

/**
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint
*/
type enterKeyHint =
| @as("enter") Enter
| @as("done") Done
| @as("go") Go
| @as("next") Next
| @as("previous") Previous
| @as("search") Search
| @as("send") Send

/**
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
*/
type inputMode =
| @as("none") None
| @as("text") Text
| @as("decimal") Decimal
| @as("numeric") Numeric
| @as("tel") Tel
| @as("search") Search
| @as("email") Email
| @as("url") Url

type inputBaseComponentProps = {
...CommonProps.clickableProps,
name?: string,
step?: int,
min?: int,
max?: int,
@as("type") type_?: string,
enterKeyHint?: enterKeyHint,
inputMode?: inputMode,
maxLength?: int,
} // FIXME: #213 there are more
...CommonProps.t,
...CommonProps.eventHandlerProps,
...CommonProps.inputTextareaProps,
}

type margin =
| @as("dense") Dense
Expand Down Expand Up @@ -129,10 +98,6 @@ type publicProps<'value> = {
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
*/
autoComplete?: string,
/**
* If `true`, the `input` element is focused during the first mount.
*/
autoFocus?: bool,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
Expand Down Expand Up @@ -244,10 +209,18 @@ type publicProps<'value> = {
* Maximum number of rows to display when multiline option is set to true.
*/
maxRows?: int,
/**
* Maximum length of the value for the input element.
*/
maxLength?: int,
/**
* Minimum number of rows to display when multiline option is set to true.
*/
minRows?: int,
/**
* Minimum length of the value for the input element.
*/
minLength?: int,
/**
* The size of the component.
*/
Expand Down Expand Up @@ -277,6 +250,10 @@ type publicProps<'value> = {
* The value of the `input` element, required for a controlled component.
*/
value?: 'value,
/**
* The textarea wrapping behavior
*/
wrap?: CommonProps.wrap,
}

type props<'value> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ type props = {
* @default 'center'
*/
alignItems?: alignItems,
/**
* If `true`, the list item is focused during the first mount.
* Focus will also be triggered if the value changes from false to true.
* @default false
*/
autoFocus?: bool,
/**
* Override or extend the styles applied to the component.
*/
Expand Down
8 changes: 0 additions & 8 deletions packages/rescript-mui-material/src/components/Menu.res
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ type classes = {

type props = {
...Popover.publicProps,
/**
* If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
* children are not focusable. If you set this prop to `false` focus will be placed
* on the parent modal container. This has severe accessibility implications
* and should only be considered if you manage focus otherwise.
* @default true
*/
autoFocus?: bool,
/**
* Override or extend the styles applied to the component.
*/
Expand Down
6 changes: 0 additions & 6 deletions packages/rescript-mui-material/src/components/MenuItem.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ type classes = {

type props<'value> = {
...ButtonBase.publicPropsWithOnClick,
/**
* If `true`, the list item is focused during the first mount.
* Focus will also be triggered if the value changes from false to true.
* @default false
*/
autoFocus?: bool,
/**
* Override or extend the styles applied to the component.
*/
Expand Down
5 changes: 0 additions & 5 deletions packages/rescript-mui-material/src/components/MenuList.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ type variant =

type props = {
...List.props,
/**
* If `true`, will focus the `[role="menu"]` container and move into tab order.
* @default false
*/
autoFocus?: bool,
/**
* If `true`, will focus the first menuitem if `variant="menu"` or selected item
* if `variant="selectedMenu"`.
Expand Down
1 change: 0 additions & 1 deletion packages/rescript-mui-material/src/components/Radio.res
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type edge =

type props<'value> = {
...ButtonBase.publicPropsWithOnClick,
autoFocus?: bool,
/**
* If `true`, the component is checked.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ type props = {
* The message to display.
*/
message?: message,
/**
* The ARIA role attribute of the element.
* @default 'alert'
*/
role?: string,
/**
* The variant to use.
* @default 'elevation'
Expand Down
Loading