@linzjs/lui 17.17.0 → 17.18.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
@@ -1,3 +1,10 @@
1
+ # [17.18.0](https://github.com/linz/lui/compare/v17.17.0...v17.18.0) (2022-10-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * Added ability to overwrite icon displayed on LuiStaticMessage ([#784](https://github.com/linz/lui/issues/784)) ([86690d2](https://github.com/linz/lui/commit/86690d2504d0369c80e775f560ea596b7a37d4c1))
7
+
1
8
  # [17.17.0](https://github.com/linz/lui/compare/v17.16.3...v17.17.0) (2022-10-13)
2
9
 
3
10
  ## [17.16.3](https://github.com/linz/lui/compare/v17.16.2...v17.16.3) (2022-10-12)
@@ -1,8 +1,9 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export interface ILuiStaticMessage {
3
3
  level: 'success' | 'info' | 'warning' | 'error';
4
4
  closable?: boolean;
5
+ icon?: string;
5
6
  className?: string;
6
- children?: React.ReactNode;
7
+ children?: ReactNode;
7
8
  }
8
9
  export declare const LuiStaticMessage: (props: ILuiStaticMessage) => JSX.Element;
package/dist/index.js CHANGED
@@ -528,9 +528,11 @@ var LuiBannerContent = function (props) {
528
528
 
529
529
  var LuiStaticMessage = function (props) {
530
530
  var _a = React.useState(true), display = _a[0], setDisplay = _a[1];
531
- var materialIcon = getMaterialIconForLevel(props.level);
531
+ var iconName = props.icon
532
+ ? props.icon
533
+ : "ic_".concat(getMaterialIconForLevel(props.level));
532
534
  return display ? (React__default["default"].createElement("div", { className: clsx("lui-msg-".concat(props.level), props.className), "data-testid": 'static-message-container' },
533
- React__default["default"].createElement(LuiIcon, { name: "ic_".concat(materialIcon), alt: "".concat(props.level, " static icon"), size: "lg", className: "lui-msg-status-icon" }),
535
+ React__default["default"].createElement(LuiIcon, { name: iconName, alt: "".concat(props.level, " static icon"), size: "lg", className: "lui-msg-status-icon" }),
534
536
  props.children,
535
537
  (props.closable === undefined || props.closable) && (React__default["default"].createElement("button", { "aria-label": "Close dialog", onClick: function () {
536
538
  setDisplay(false);