@linzjs/lui 15.1.3 → 15.1.4

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
+ ## [15.1.4](https://github.com/linz/lui/compare/v15.1.3...v15.1.4) (2022-03-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **LuiButtonGroup:** Support single child ([#561](https://github.com/linz/lui/issues/561)) ([#602](https://github.com/linz/lui/issues/602)) ([50162d3](https://github.com/linz/lui/commit/50162d38e00469a3b32879874fd79a998115bee2))
7
+
1
8
  ## [15.1.3](https://github.com/linz/lui/compare/v15.1.2...v15.1.3) (2022-03-03)
2
9
 
3
10
 
@@ -24,6 +24,19 @@ export declare const PlainButton: React.ForwardRefExoticComponent<Pick<PlainButt
24
24
  size: string;
25
25
  }, "type" | "disabled" | "style" | "onClick" | "name" | "title" | "data-testid" | "className" | "buttonProps" | "children" | "level" | "size"> & React.RefAttributes<HTMLButtonElement>>;
26
26
  export declare const LuiButton: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<LuiButtonProps>, "type" | "disabled" | "style" | "onClick" | "name" | "title" | "data-testid" | "className" | "buttonProps" | "children" | "level" | "size" | "href" | "openInNewTab"> & React.RefAttributes<HTMLButtonElement>>;
27
- export declare const LuiButtonGroup: React.FC<{
28
- children: any;
29
- }>;
27
+ interface LuiButtonGroupProps {
28
+ /**
29
+ * LuiButton component(s) to render in series.
30
+ *
31
+ * While a single child element is technically supported, we recommend using
32
+ * disabled styling for unavailable operations in order to communicate
33
+ * possible actions. Please consult with the UX team before breaking this
34
+ * style guideline.
35
+ */
36
+ children: ReactNode;
37
+ }
38
+ /**
39
+ * A series of Lui buttons together.
40
+ */
41
+ export declare const LuiButtonGroup: (props: LuiButtonGroupProps) => JSX.Element;
42
+ export {};
package/dist/index.js CHANGED
@@ -207,8 +207,14 @@ var LuiButton = React__default["default"].forwardRef(function (props, ref) {
207
207
  }
208
208
  return (React__default["default"].createElement(PlainButton, { type: props.type, title: props.title, disabled: props.disabled, name: props.name, onClick: props.onClick, level: _level, size: size, "data-testid": props['data-testid'], style: props.style, className: props.className, buttonProps: props.buttonProps, ref: ref }, props.children));
209
209
  });
210
+ /**
211
+ * A series of Lui buttons together.
212
+ */
210
213
  var LuiButtonGroup = function (props) {
211
- return (React__default["default"].createElement("div", { className: "lui-button-group", "data-testid": 'button-group' }, props.children.map(function (child, i) {
214
+ var children = Array.isArray(props.children)
215
+ ? props.children
216
+ : [props.children];
217
+ return (React__default["default"].createElement("div", { className: "lui-button-group", "data-testid": 'button-group' }, children.map(function (child, i) {
212
218
  return (React__default["default"].createElement("div", { key: i, className: 'lui-button-wrapper' }, child));
213
219
  })));
214
220
  };