@availity/mui-button 0.3.1 → 0.4.1

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 CHANGED
@@ -2,23 +2,36 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.4.1](https://github.com/Availity/element/compare/@availity/mui-button@0.4.0...@availity/mui-button@0.4.1) (2023-10-03)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **mui-button:** fix styling for pure icon button ([9d4a524](https://github.com/Availity/element/commit/9d4a524388d512ecc27e8e803b536036f6fedbc6))
11
+
12
+ ## [0.4.0](https://github.com/Availity/element/compare/@availity/mui-button@0.3.1...@availity/mui-button@0.4.0) (2023-09-26)
13
+
14
+
15
+ ### Features
16
+
17
+ * **mui-button:** icon button styling ([43c424e](https://github.com/Availity/element/commit/43c424e2f33b0dcd9dca51ec253e54ea3309630b))
18
+ * **mui-icon:** add xsmall fontsize ([aa8e28a](https://github.com/Availity/element/commit/aa8e28a5a7514247db0f65d9120da2847663445a))
19
+
5
20
  ## [0.3.1](https://github.com/Availity/element/compare/@availity/mui-button@0.3.0...@availity/mui-button@0.3.1) (2023-08-23)
6
21
 
7
22
  ## [0.3.0](https://github.com/Availity/element/compare/@availity/mui-button@0.2.1...@availity/mui-button@0.3.0) (2023-08-16)
8
23
 
9
-
10
24
  ### Features
11
25
 
12
- * **mui-button:** remove contained iconbutton styles ([a6ee9c9](https://github.com/Availity/element/commit/a6ee9c948fb1511ec2a1bd8b91b0486a1cef53fd))
26
+ - **mui-button:** remove contained iconbutton styles ([a6ee9c9](https://github.com/Availity/element/commit/a6ee9c948fb1511ec2a1bd8b91b0486a1cef53fd))
13
27
 
14
28
  ## [0.2.1](https://github.com/Availity/element/compare/@availity/mui-button@0.2.0...@availity/mui-button@0.2.1) (2023-07-31)
15
29
 
16
30
  ## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-button@0.1.3...@availity/mui-button@0.2.0) (2023-06-01)
17
31
 
18
-
19
32
  ### Features
20
33
 
21
- * **mui-button:** design specs ([6b67b24](https://github.com/Availity/element/commit/6b67b24cdfef68e14daaeba18a5fd7d90af46a09))
34
+ - **mui-button:** design specs ([6b67b24](https://github.com/Availity/element/commit/6b67b24cdfef68e14daaeba18a5fd7d90af46a09))
22
35
 
23
36
  ## [0.1.3](https://github.com/Availity/element/compare/@availity/mui-button@0.1.2...@availity/mui-button@0.1.3) (2023-04-07)
24
37
 
@@ -28,13 +41,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
28
41
 
29
42
  ## 0.1.0 (2023-03-01)
30
43
 
31
-
32
44
  ### Features
33
45
 
34
- * **buttons:** create new buttons ([d2dfb1a](https://github.com/Availity/element/commit/d2dfb1af0491adbcdb7d86c5a65d90d23dec5b4a))
35
- * **buttons:** typo fixes ([ee06ad4](https://github.com/Availity/element/commit/ee06ad435771bde574509855accb46cd69f4c48c))
36
-
46
+ - **buttons:** create new buttons ([d2dfb1a](https://github.com/Availity/element/commit/d2dfb1af0491adbcdb7d86c5a65d90d23dec5b4a))
47
+ - **buttons:** typo fixes ([ee06ad4](https://github.com/Availity/element/commit/ee06ad435771bde574509855accb46cd69f4c48c))
37
48
 
38
49
  ### Bug Fixes
39
50
 
40
- * remove unnecessary dep ([269e2ab](https://github.com/Availity/element/commit/269e2abe45bf7109a1b263ae5fcac71d3afb5d05))
51
+ - remove unnecessary dep ([269e2ab](https://github.com/Availity/element/commit/269e2abe45bf7109a1b263ae5fcac71d3afb5d05))
package/dist/index.d.ts CHANGED
@@ -25,8 +25,19 @@ type IconButtonProps = {
25
25
  * Text for tooltip and aria-label
26
26
  */
27
27
  title: string;
28
- } & Omit<IconButtonProps$1, 'aria-label' | 'centerRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'disableFocusRipple' | 'TouchRippleProps' | 'touchRippleRef'>;
29
- declare const IconButton: react.ForwardRefExoticComponent<Pick<IconButtonProps, keyof _mui_material_OverridableComponent.CommonProps | "form" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "disabled" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "size" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "edge"> & react.RefAttributes<HTMLButtonElement>>;
28
+ /**
29
+ * The variant to use
30
+ * @default 'text'
31
+ */
32
+ variant?: 'outlined' | 'text';
33
+ /**
34
+ * The color of the component
35
+ * @default 'secondary'
36
+ */
37
+ color?: 'primary' | 'secondary';
38
+ size?: 'small' | 'medium';
39
+ } & Omit<IconButtonProps$1, 'aria-label' | 'color' | 'centerRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'disableFocusRipple' | 'TouchRippleProps' | 'touchRippleRef'>;
40
+ declare const IconButton: react.ForwardRefExoticComponent<Pick<IconButtonProps, keyof _mui_material_OverridableComponent.CommonProps | "form" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "disabled" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "size" | "variant" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "edge"> & react.RefAttributes<HTMLButtonElement>>;
30
41
 
31
42
  type LoadingButtonProps = {
32
43
  children: React.ReactNode;
package/dist/index.js CHANGED
@@ -53,17 +53,22 @@ var Button = (0, import_react.forwardRef)((props, ref) => {
53
53
  var import_react2 = require("react");
54
54
  var import_material2 = require("@mui/material");
55
55
  var import_jsx_runtime = require("react/jsx-runtime");
56
- var overrideProps2 = {
57
- disableRipple: true
56
+ var outlinedStyles = {
57
+ borderRadius: ".25rem",
58
+ border: 1
58
59
  };
59
60
  var IconButton = (0, import_react2.forwardRef)((props, ref) => {
60
- const { title, ...rest } = props;
61
+ const { title, variant = "text", sx, ...rest } = props;
62
+ const styles = {
63
+ ...sx,
64
+ ...variant === "outlined" && outlinedStyles
65
+ };
61
66
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.Tooltip, {
62
67
  title,
63
68
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.IconButton, {
64
69
  "aria-label": title,
70
+ sx: { ...styles },
65
71
  ...rest,
66
- ...overrideProps2,
67
72
  ref
68
73
  })
69
74
  });
package/dist/index.mjs CHANGED
@@ -19,17 +19,22 @@ var Button = forwardRef((props, ref) => {
19
19
  import { forwardRef as forwardRef2 } from "react";
20
20
  import { IconButton as MuiIconButton, Tooltip } from "@mui/material";
21
21
  import { jsx as jsx2 } from "react/jsx-runtime";
22
- var overrideProps2 = {
23
- disableRipple: true
22
+ var outlinedStyles = {
23
+ borderRadius: ".25rem",
24
+ border: 1
24
25
  };
25
26
  var IconButton = forwardRef2((props, ref) => {
26
- const { title, ...rest } = props;
27
+ const { title, variant = "text", sx, ...rest } = props;
28
+ const styles = {
29
+ ...sx,
30
+ ...variant === "outlined" && outlinedStyles
31
+ };
27
32
  return /* @__PURE__ */ jsx2(Tooltip, {
28
33
  title,
29
34
  children: /* @__PURE__ */ jsx2(MuiIconButton, {
30
35
  "aria-label": title,
36
+ sx: { ...styles },
31
37
  ...rest,
32
- ...overrideProps2,
33
38
  ref
34
39
  })
35
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-button",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "Availity MUI Button Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -7,9 +7,21 @@ export type IconButtonProps = {
7
7
  * Text for tooltip and aria-label
8
8
  */
9
9
  title: string;
10
+ /**
11
+ * The variant to use
12
+ * @default 'text'
13
+ */
14
+ variant?: 'outlined' | 'text';
15
+ /**
16
+ * The color of the component
17
+ * @default 'secondary'
18
+ */
19
+ color?: 'primary' | 'secondary';
20
+ size?: 'small' | 'medium';
10
21
  } & Omit<
11
22
  MUIIconButtonProps,
12
23
  | 'aria-label'
24
+ | 'color'
13
25
  | 'centerRipple'
14
26
  | 'disableRipple'
15
27
  | 'disableTouchRipple'
@@ -19,15 +31,21 @@ export type IconButtonProps = {
19
31
  | 'touchRippleRef'
20
32
  >;
21
33
 
22
- const overrideProps = {
23
- disableRipple: true,
34
+ // IconButtonVariants not planned until v6 :(
35
+ const outlinedStyles = {
36
+ borderRadius: '.25rem',
37
+ border: 1,
24
38
  };
25
39
 
26
40
  export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, ref) => {
27
- const { title, ...rest } = props;
41
+ const { title, variant = 'text', sx, ...rest } = props;
42
+ const styles = {
43
+ ...sx,
44
+ ...(variant === 'outlined' && outlinedStyles),
45
+ };
28
46
  return (
29
47
  <Tooltip title={title}>
30
- <MuiIconButton aria-label={title} {...rest} {...overrideProps} ref={ref} />
48
+ <MuiIconButton aria-label={title} sx={{ ...styles }} {...rest} ref={ref} />
31
49
  </Tooltip>
32
50
  );
33
51
  });