@availity/mui-button 0.3.0 → 0.4.0

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,21 +2,29 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
- ## [0.3.0](https://github.com/Availity/element/compare/@availity/mui-button@0.2.1...@availity/mui-button@0.3.0) (2023-08-16)
5
+ ## [0.4.0](https://github.com/Availity/element/compare/@availity/mui-button@0.3.1...@availity/mui-button@0.4.0) (2023-09-26)
6
+
7
+
8
+ ### Features
9
+
10
+ * **mui-button:** icon button styling ([43c424e](https://github.com/Availity/element/commit/43c424e2f33b0dcd9dca51ec253e54ea3309630b))
11
+ * **mui-icon:** add xsmall fontsize ([aa8e28a](https://github.com/Availity/element/commit/aa8e28a5a7514247db0f65d9120da2847663445a))
6
12
 
13
+ ## [0.3.1](https://github.com/Availity/element/compare/@availity/mui-button@0.3.0...@availity/mui-button@0.3.1) (2023-08-23)
14
+
15
+ ## [0.3.0](https://github.com/Availity/element/compare/@availity/mui-button@0.2.1...@availity/mui-button@0.3.0) (2023-08-16)
7
16
 
8
17
  ### Features
9
18
 
10
- * **mui-button:** remove contained iconbutton styles ([a6ee9c9](https://github.com/Availity/element/commit/a6ee9c948fb1511ec2a1bd8b91b0486a1cef53fd))
19
+ - **mui-button:** remove contained iconbutton styles ([a6ee9c9](https://github.com/Availity/element/commit/a6ee9c948fb1511ec2a1bd8b91b0486a1cef53fd))
11
20
 
12
21
  ## [0.2.1](https://github.com/Availity/element/compare/@availity/mui-button@0.2.0...@availity/mui-button@0.2.1) (2023-07-31)
13
22
 
14
23
  ## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-button@0.1.3...@availity/mui-button@0.2.0) (2023-06-01)
15
24
 
16
-
17
25
  ### Features
18
26
 
19
- * **mui-button:** design specs ([6b67b24](https://github.com/Availity/element/commit/6b67b24cdfef68e14daaeba18a5fd7d90af46a09))
27
+ - **mui-button:** design specs ([6b67b24](https://github.com/Availity/element/commit/6b67b24cdfef68e14daaeba18a5fd7d90af46a09))
20
28
 
21
29
  ## [0.1.3](https://github.com/Availity/element/compare/@availity/mui-button@0.1.2...@availity/mui-button@0.1.3) (2023-04-07)
22
30
 
@@ -26,13 +34,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
26
34
 
27
35
  ## 0.1.0 (2023-03-01)
28
36
 
29
-
30
37
  ### Features
31
38
 
32
- * **buttons:** create new buttons ([d2dfb1a](https://github.com/Availity/element/commit/d2dfb1af0491adbcdb7d86c5a65d90d23dec5b4a))
33
- * **buttons:** typo fixes ([ee06ad4](https://github.com/Availity/element/commit/ee06ad435771bde574509855accb46cd69f4c48c))
34
-
39
+ - **buttons:** create new buttons ([d2dfb1a](https://github.com/Availity/element/commit/d2dfb1af0491adbcdb7d86c5a65d90d23dec5b4a))
40
+ - **buttons:** typo fixes ([ee06ad4](https://github.com/Availity/element/commit/ee06ad435771bde574509855accb46cd69f4c48c))
35
41
 
36
42
  ### Bug Fixes
37
43
 
38
- * remove unnecessary dep ([269e2ab](https://github.com/Availity/element/commit/269e2abe45bf7109a1b263ae5fcac71d3afb5d05))
44
+ - 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,24 @@ 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 textStyles = {
57
+ border: "none"
58
+ };
59
+ var outlinedStyles = {
60
+ borderRadius: ".25rem"
58
61
  };
59
62
  var IconButton = (0, import_react2.forwardRef)((props, ref) => {
60
- const { title, ...rest } = props;
63
+ const { title, variant = "text", sx, ...rest } = props;
64
+ const styles = {
65
+ ...sx,
66
+ ...variant === "text" ? textStyles : outlinedStyles
67
+ };
61
68
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.Tooltip, {
62
69
  title,
63
70
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.IconButton, {
64
71
  "aria-label": title,
72
+ sx: { ...styles },
65
73
  ...rest,
66
- ...overrideProps2,
67
74
  ref
68
75
  })
69
76
  });
package/dist/index.mjs CHANGED
@@ -19,17 +19,24 @@ 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 textStyles = {
23
+ border: "none"
24
+ };
25
+ var outlinedStyles = {
26
+ borderRadius: ".25rem"
24
27
  };
25
28
  var IconButton = forwardRef2((props, ref) => {
26
- const { title, ...rest } = props;
29
+ const { title, variant = "text", sx, ...rest } = props;
30
+ const styles = {
31
+ ...sx,
32
+ ...variant === "text" ? textStyles : outlinedStyles
33
+ };
27
34
  return /* @__PURE__ */ jsx2(Tooltip, {
28
35
  title,
29
36
  children: /* @__PURE__ */ jsx2(MuiIconButton, {
30
37
  "aria-label": title,
38
+ sx: { ...styles },
31
39
  ...rest,
32
- ...overrideProps2,
33
40
  ref
34
41
  })
35
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-button",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Availity MUI Button Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
package/project.json CHANGED
@@ -37,5 +37,6 @@
37
37
  "tagPrefix": "@availity/${projectName}@"
38
38
  }
39
39
  }
40
- }
40
+ },
41
+ "trackDeps": true
41
42
  }
@@ -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,24 @@ export type IconButtonProps = {
19
31
  | 'touchRippleRef'
20
32
  >;
21
33
 
22
- const overrideProps = {
23
- disableRipple: true,
34
+ // IconButtonVariants not planned until v6 :(
35
+ const textStyles = {
36
+ border: 'none',
37
+ };
38
+
39
+ const outlinedStyles = {
40
+ borderRadius: '.25rem',
24
41
  };
25
42
 
26
43
  export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>((props, ref) => {
27
- const { title, ...rest } = props;
44
+ const { title, variant = 'text', sx, ...rest } = props;
45
+ const styles = {
46
+ ...sx,
47
+ ...(variant === 'text' ? textStyles : outlinedStyles),
48
+ };
28
49
  return (
29
50
  <Tooltip title={title}>
30
- <MuiIconButton aria-label={title} {...rest} {...overrideProps} ref={ref} />
51
+ <MuiIconButton aria-label={title} sx={{ ...styles }} {...rest} ref={ref} />
31
52
  </Tooltip>
32
53
  );
33
54
  });