@linzjs/lui 24.17.0 → 24.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
@@ -5,6 +5,13 @@
5
5
 
6
6
  * **LuiComboSelect:** restore interface to support styling of the input element. ([#1270](https://github.com/linz/lui/issues/1270)) ([7ce6a13](https://github.com/linz/lui/commit/7ce6a137c7f16ffa3acbe4357569a6eb59ef47db))
7
7
 
8
+ ## [24.18.0](https://github.com/linz/Lui/compare/lui-v24.17.0...lui-v24.18.0) (2026-07-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * **LuiBannerV2:** SEARCH-8308 allow a custom icon to be passed through to a banner ([#1374](https://github.com/linz/Lui/issues/1374)) ([94ae1e2](https://github.com/linz/Lui/commit/94ae1e242a45082b90806a8812652e10b1b3c4b7))
14
+
8
15
  ## [24.17.0](https://github.com/linz/Lui/compare/lui-v24.16.1...lui-v24.17.0) (2026-06-16)
9
16
 
10
17
 
@@ -1,6 +1,7 @@
1
1
  import './LuiBannerV2.scss';
2
2
  import { ComponentPropsWithoutRef } from 'react';
3
3
  import React from 'react';
4
+ import { IconName } from '../LuiIcon/LuiIcon';
4
5
  type Button = ComponentPropsWithoutRef<'button'>;
5
6
  type Dismiss = {
6
7
  onDismiss: Button['onClick'];
@@ -11,6 +12,11 @@ type Dismiss = {
11
12
  };
12
13
  type Props = {
13
14
  level?: 'warning' | 'error' | 'info' | 'success';
15
+ /**
16
+ * The name of a `LuiIcon` to display in the banner. Overrides the icon
17
+ * derived from `level`, allowing a custom banner.
18
+ */
19
+ iconName?: IconName;
14
20
  } & Dismiss & ComponentPropsWithoutRef<'div'>;
15
21
  export declare const LuiBannerV2: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
16
22
  export {};
package/dist/index.js CHANGED
@@ -41235,8 +41235,8 @@ styleInject(css_248z$7);
41235
41235
 
41236
41236
  var LuiBannerV2 = React.forwardRef(function (_a, ref) {
41237
41237
  var _b, _c, _d;
41238
- var level = _a.level, onDismiss = _a.onDismiss, className = _a.className, children = _a.children, dismissButtonProps = _a.dismissButtonProps, props = __rest(_a, ["level", "onDismiss", "className", "children", "dismissButtonProps"]);
41239
- var icon = (function () {
41238
+ var level = _a.level, iconName = _a.iconName, onDismiss = _a.onDismiss, className = _a.className, children = _a.children, dismissButtonProps = _a.dismissButtonProps, props = __rest(_a, ["level", "iconName", "onDismiss", "className", "children", "dismissButtonProps"]);
41239
+ var icon = iconName !== null && iconName !== void 0 ? iconName : (function () {
41240
41240
  switch (level) {
41241
41241
  case 'success':
41242
41242
  return "ic_check_circle_outline";
@@ -41246,7 +41246,7 @@ var LuiBannerV2 = React.forwardRef(function (_a, ref) {
41246
41246
  })();
41247
41247
  return (React__default["default"].createElement("div", __assign({ ref: ref, className: clsx$1('LuiBannerV2', level, icon && 'has-level', onDismiss && 'can-dismiss', className) }, props),
41248
41248
  children,
41249
- icon && (React__default["default"].createElement(LuiIcon, { className: clsx$1('LuiBannerV2-Icon', level), size: "lg", name: icon, spanProps: { 'aria-hidden': true }, alt: level })),
41249
+ icon && (React__default["default"].createElement(LuiIcon, { className: clsx$1('LuiBannerV2-Icon', level), size: "lg", name: icon, spanProps: { 'aria-hidden': true }, alt: level !== null && level !== void 0 ? level : '' })),
41250
41250
  onDismiss && (React__default["default"].createElement("button", __assign({}, dismissButtonProps, { className: clsx$1('LuiBannerV2-Dismiss', dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.className), "aria-label": (_b = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps['aria-label']) !== null && _b !== void 0 ? _b : 'Dismiss', type: (_c = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.type) !== null && _c !== void 0 ? _c : 'button', onClick: onDismiss }), (_d = dismissButtonProps === null || dismissButtonProps === void 0 ? void 0 : dismissButtonProps.children) !== null && _d !== void 0 ? _d : (React__default["default"].createElement(LuiIcon, { size: "md", name: "ic_clear", spanProps: { 'aria-hidden': true }, alt: "Dismiss" }))))));
41251
41251
  });
41252
41252