@availity/mui-button 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -5
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
- package/src/lib/Button.tsx +1 -2
- package/src/lib/IconButton.tsx +2 -2
- package/src/lib/bs4migration.stories.mdx +55 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.6.6](https://github.com/Availity/element/compare/@availity/mui-button@0.6.5...@availity/mui-button@0.6.6) (2024-04-15)
|
|
6
|
+
|
|
7
|
+
## [0.6.5](https://github.com/Availity/element/compare/@availity/mui-button@0.6.4...@availity/mui-button@0.6.5) (2024-04-04)
|
|
8
|
+
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
|
|
11
|
+
* `mui-layout` updated to version `0.1.5`
|
|
12
|
+
* `mui-icon` updated to version `0.8.1`
|
|
13
|
+
|
|
14
|
+
### Performance Improvements
|
|
15
|
+
|
|
16
|
+
* **mui-button:** use path imports for material deps ([5675780](https://github.com/Availity/element/commit/567578011d9d9b6e0736fb735c87ed7d619756c7))
|
|
17
|
+
|
|
5
18
|
## [0.6.4](https://github.com/Availity/element/compare/@availity/mui-button@0.6.3...@availity/mui-button@0.6.4) (2024-03-15)
|
|
6
19
|
|
|
7
20
|
### Dependency Updates
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonProps as ButtonProps$1
|
|
2
|
+
import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
|
|
3
|
+
import { IconButtonProps as IconButtonProps$1 } from '@mui/material/IconButton';
|
|
3
4
|
import { LoadingButtonProps as LoadingButtonProps$1 } from '@mui/lab/LoadingButton';
|
|
4
5
|
|
|
5
6
|
declare module '@mui/material/Button' {
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
34
34
|
|
|
35
35
|
// src/lib/Button.tsx
|
|
36
36
|
var import_react = require("react");
|
|
37
|
-
var
|
|
37
|
+
var import_Button = __toESM(require("@mui/material/Button"));
|
|
38
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
39
|
var overrideProps = {
|
|
40
40
|
disableRipple: true,
|
|
@@ -42,7 +42,7 @@ var overrideProps = {
|
|
|
42
42
|
disableTouchRipple: true
|
|
43
43
|
};
|
|
44
44
|
var Button = (0, import_react.forwardRef)((props, ref) => {
|
|
45
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, {
|
|
46
46
|
...props,
|
|
47
47
|
...overrideProps,
|
|
48
48
|
ref
|
|
@@ -51,7 +51,8 @@ var Button = (0, import_react.forwardRef)((props, ref) => {
|
|
|
51
51
|
|
|
52
52
|
// src/lib/IconButton.tsx
|
|
53
53
|
var import_react2 = require("react");
|
|
54
|
-
var
|
|
54
|
+
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
55
|
+
var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
|
|
55
56
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
57
|
var outlinedStyles = {
|
|
57
58
|
borderRadius: ".25rem",
|
|
@@ -63,9 +64,9 @@ var IconButton = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
63
64
|
...sx,
|
|
64
65
|
...variant === "outlined" && outlinedStyles
|
|
65
66
|
};
|
|
66
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Tooltip.default, {
|
|
67
68
|
title,
|
|
68
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_IconButton.default, {
|
|
69
70
|
"aria-label": title,
|
|
70
71
|
sx: { ...styles },
|
|
71
72
|
...rest,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/lib/Button.tsx
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { default as MUIButton } from "@mui/material/Button";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
var overrideProps = {
|
|
6
6
|
disableRipple: true,
|
|
@@ -17,7 +17,8 @@ var Button = forwardRef((props, ref) => {
|
|
|
17
17
|
|
|
18
18
|
// src/lib/IconButton.tsx
|
|
19
19
|
import { forwardRef as forwardRef2 } from "react";
|
|
20
|
-
import {
|
|
20
|
+
import { default as MuiIconButton } from "@mui/material/IconButton";
|
|
21
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
21
22
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
22
23
|
var outlinedStyles = {
|
|
23
24
|
borderRadius: ".25rem",
|
package/package.json
CHANGED
package/src/lib/Button.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import type { ButtonProps as MUIButtonProps } from '@mui/material';
|
|
2
|
+
import { default as MUIButton, ButtonProps as MUIButtonProps } from '@mui/material/Button';
|
|
4
3
|
|
|
5
4
|
declare module '@mui/material/Button' {
|
|
6
5
|
interface ButtonPropsColorOverrides {
|
package/src/lib/IconButton.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { default as MuiIconButton, IconButtonProps as MUIIconButtonProps } from '@mui/material/IconButton';
|
|
3
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
4
4
|
|
|
5
5
|
export type IconButtonProps = {
|
|
6
6
|
/**
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Meta, Source } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="BS4 Migration/Button" />
|
|
4
|
+
|
|
5
|
+
# Component Migration
|
|
6
|
+
|
|
7
|
+
This migration guide is just an overview. For more in depth component information, visit:
|
|
8
|
+
- [Availity Usage Guide](https://zeroheight.com/2e36e50c7/p/54f663-button)
|
|
9
|
+
- [MUI Documentation](https://mui.com/material-ui/react-button/)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Key Differences (not exhaustive list)
|
|
13
|
+
|
|
14
|
+
- Changed
|
|
15
|
+
- Per UX, the available colors for a button have changed, notably the removal of success and error colors.
|
|
16
|
+
- Removed
|
|
17
|
+
- `outline` while mui moves this option into the `variant` prop, per UX this variant has also been removed going forward.
|
|
18
|
+
- Other
|
|
19
|
+
- UX has updated the guidelines for when to use which color. Refer to zeroheight docs for more information.
|
|
20
|
+
|
|
21
|
+
## Code Examples
|
|
22
|
+
|
|
23
|
+
`reactstrap`/`availity-react` Example:
|
|
24
|
+
|
|
25
|
+
<Source
|
|
26
|
+
code={`
|
|
27
|
+
import { Button } from 'reactstrap';\n
|
|
28
|
+
const ReactstrapButton = () => (
|
|
29
|
+
<Button
|
|
30
|
+
color="primary"
|
|
31
|
+
size="lg"
|
|
32
|
+
outline
|
|
33
|
+
block
|
|
34
|
+
>
|
|
35
|
+
I'm a Button
|
|
36
|
+
</Button>
|
|
37
|
+
);
|
|
38
|
+
`}/>
|
|
39
|
+
|
|
40
|
+
`@availity/element` Example:
|
|
41
|
+
|
|
42
|
+
<Source
|
|
43
|
+
code={`
|
|
44
|
+
import { Button } from '@availity/element';\n
|
|
45
|
+
const MUIButton = () => (
|
|
46
|
+
<Button
|
|
47
|
+
color="primary"
|
|
48
|
+
size="large"
|
|
49
|
+
variant="outlined"
|
|
50
|
+
fullWidth
|
|
51
|
+
>
|
|
52
|
+
I'm a Button
|
|
53
|
+
</Button>
|
|
54
|
+
);
|
|
55
|
+
`}/>
|