@linzjs/lui 21.13.0 → 21.14.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
+ # [21.14.0](https://github.com/linz/lui/compare/v21.13.0...v21.14.0) (2023-12-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * CS-2952 - allow secondary styling on LuiSplitButton ([90049f7](https://github.com/linz/lui/commit/90049f7f9c6650d838caa613e899130e5981671e))
7
+
1
8
  # [21.13.0](https://github.com/linz/lui/compare/v21.12.1...v21.13.0) (2023-12-03)
2
9
 
3
10
 
@@ -10,6 +10,7 @@ export interface ILuiSplitButtonProps {
10
10
  disabled?: boolean;
11
11
  children: React.ReactNode;
12
12
  'data-testid'?: string;
13
+ level?: 'primary' | 'secondary';
13
14
  }
14
15
  export interface ILuiSplitButtonMenuItemProps extends MenuItemProps {
15
16
  children: React.ReactNode;
package/dist/index.js CHANGED
@@ -42471,19 +42471,18 @@ var LuiSplitButton = function (_a) {
42471
42471
  var _d = React.useState(false), isExpanded = _d[0], setIsExpanded = _d[1];
42472
42472
  // Let the consumer set any LuiButtonProps they want but overwrite the ones we want to control
42473
42473
  var buttonProps = __assign(__assign({}, props.buttonProps), {
42474
- level: 'primary',
42474
+ level: props.level || 'primary',
42475
42475
  className: clsx('lui-split-button-primary-btn', (_b = props.buttonProps) === null || _b === void 0 ? void 0 : _b.className)
42476
42476
  });
42477
42477
  var positionProps = getMenuPosition(position);
42478
42478
  var iconClassName = getIconClassName(position, isExpanded);
42479
42479
  return (React__default["default"].createElement("div", { className: clsx('lui-split-button', props.className) },
42480
- React__default["default"].createElement(LuiButton, __assign({}, buttonProps, { disabled: props.disabled }),
42481
- ' ',
42482
- props.buttonLabel,
42483
- ' '),
42480
+ React__default["default"].createElement(LuiButton, __assign({}, buttonProps, { disabled: props.disabled }), props.buttonLabel),
42484
42481
  React__default["default"].createElement(reactMenu.Menu, __assign({ menuClassName: 'lui-split-button-menu', onMenuChange: function () {
42485
42482
  setIsExpanded(function (prev) { return !prev; });
42486
- }, menuButton: React__default["default"].createElement("button", { disabled: props.disabled, className: clsx('popup-toggle-button'), "data-testid": props['data-testid'], type: "button" },
42483
+ }, menuButton: React__default["default"].createElement("button", { disabled: props.disabled, className: clsx('popup-toggle-button', {
42484
+ 'popup-toggle-button-secondary': props.level === 'secondary'
42485
+ }), "data-testid": props['data-testid'], type: "button" },
42487
42486
  React__default["default"].createElement("i", { className: clsx(iconClassName) }, 'expand_more')) }, positionProps, props.menuProps), props.children)));
42488
42487
  };
42489
42488
  //required by react menu wrapping