@linzjs/lui 15.1.1 → 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,24 @@
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
+
8
+ ## [15.1.3](https://github.com/linz/lui/compare/v15.1.2...v15.1.3) (2022-03-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * added Hot Pink to the colour palette ([#600](https://github.com/linz/lui/issues/600)) ([a09285e](https://github.com/linz/lui/commit/a09285e1d5bdc80771beb1fecbc9232e289267f4))
14
+
15
+ ## [15.1.2](https://github.com/linz/lui/compare/v15.1.1...v15.1.2) (2022-03-03)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Deprecated Formik coupled inputs ([#586](https://github.com/linz/lui/issues/586)) ([d05916f](https://github.com/linz/lui/commit/d05916ff803d145310e82c494a9414cd01a2750d))
21
+
1
22
  ## [15.1.1](https://github.com/linz/lui/compare/v15.1.0...v15.1.1) (2022-03-02)
2
23
 
3
24
 
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  ![https://en.wikipedia.org/wiki/Onychophora](lui-worm.png)
14
14
 
15
- > Lui _[Onychophora](https://en.wikipedia.org/wiki/Onychophora)_, the happy UI worm!
15
+ > Lui _[Onychophora](https://en.wikipedia.org/wiki/Onychophora)_, the happy UI worm!!
16
16
 
17
17
  Nomenclature: Lui is a backronym for Linz User Interface. Lui the library, is named after Lui the worm.
18
18
 
@@ -31,15 +31,19 @@ and...
31
31
 
32
32
  ---
33
33
 
34
- _Lui_ is a collection of generic UI components that adhere to the new LINZ digital style guide, lead by STEP and welcoming contributions from across LINZ.
34
+ _Lui_ is a collection of generic UI components that adhere to the new LINZ digital style guide, lead by STEP and
35
+ welcoming contributions from across LINZ.
35
36
 
36
- It aims to solve the problem of consistent UI across LINZ while giving squads a bunch of base elements they can start using out of the box.
37
+ It aims to solve the problem of consistent UI across LINZ while giving squads a bunch of base elements they can start
38
+ using out of the box.
37
39
 
38
40
  We aim to make each component generic, extendable, accessible, and amazingly great.
39
41
 
40
- All styles are implemented in SASS and compiled to plain CSS. This means any team can use the CSS. A ReactJS wrapper over the CSS is part of this project.
42
+ All styles are implemented in SASS and compiled to plain CSS. This means any team can use the CSS. A ReactJS wrapper
43
+ over the CSS is part of this project.
41
44
 
42
- There is lots to do in this project, often things will be left until there is demand. Please join the Slack channel #cop-lui.
45
+ There is lots to do in this project, often things will be left until there is demand. Please join the Slack channel
46
+ #cop-lui.
43
47
 
44
48
  ## Documentation
45
49
 
@@ -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 {};
@@ -0,0 +1 @@
1
+ export declare function useDeprecatedWarning(componentName: string): void;
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
  };
@@ -468,7 +474,16 @@ var LuiTabsPanelSwitch = function (props) {
468
474
  } }, props.children));
469
475
  };
470
476
 
477
+ function useDeprecatedWarning(componentName) {
478
+ React.useEffect(function () {
479
+ if (window.location.hostname.includes('localhost')) {
480
+ console.warn(componentName + " will be deprecated in future versions of Lui. Please see the 'Current Deprecations' page in Lui docs.");
481
+ }
482
+ }, []);
483
+ }
484
+
471
485
  function LuiFormikForm(props) {
486
+ useDeprecatedWarning('LuiFormikForm');
472
487
  // this spreads all keys, except className
473
488
  var _a = __assign({}, props); _a.className; var formikProps = __rest(_a, ["className"]);
474
489
  var classNames = clsx(props.className);
@@ -1024,6 +1039,7 @@ var LuiRadioInput = function (props) {
1024
1039
  };
1025
1040
 
1026
1041
  function LuiFormikCheckbox(props) {
1042
+ useDeprecatedWarning('LuiFormikCheckbox');
1027
1043
  var ctx = formik.useFormikContext();
1028
1044
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1029
1045
  React__default["default"].createElement(formik.Field, { name: props.name }, function (_a) {
@@ -1038,18 +1054,22 @@ function LuiFormikCheckbox(props) {
1038
1054
  })));
1039
1055
  }
1040
1056
 
1041
- var LuiFormikFormLabel = function (props) { return (React__default["default"].createElement("div", { className: clsx('LuiFormLabel-wrapper', props.className && "" + props.className) },
1042
- props.children,
1043
- React__default["default"].createElement("label", { className: "LuiFormLabel", htmlFor: props["for"] },
1044
- props.required && React__default["default"].createElement("span", { className: "lui-required-input-icon" }, "*"),
1045
- props.label),
1046
- props.tooltip && React__default["default"].createElement("i", { className: "material-icons-round" }, "help"))); };
1057
+ var LuiFormikFormLabel = function (props) {
1058
+ useDeprecatedWarning('LuiFormikFormLabel');
1059
+ return (React__default["default"].createElement("div", { className: clsx('LuiFormLabel-wrapper', props.className && "" + props.className) },
1060
+ props.children,
1061
+ React__default["default"].createElement("label", { className: "LuiFormLabel", htmlFor: props["for"] },
1062
+ props.required && React__default["default"].createElement("span", { className: "lui-required-input-icon" }, "*"),
1063
+ props.label),
1064
+ props.tooltip && React__default["default"].createElement("i", { className: "material-icons-round" }, "help")));
1065
+ };
1047
1066
 
1048
1067
  var LuiFormikTextInput = formik.connect(function (props) {
1049
1068
  var error = formik.getIn(props.formik.errors, props.name);
1050
1069
  var touch = formik.getIn(props.formik.touched, props.name);
1051
1070
  var showError = touch && error;
1052
1071
  var setFieldValue = formik.useFormikContext().setFieldValue;
1072
+ useDeprecatedWarning('LuiFormikTextInput');
1053
1073
  var multiLineToggle = function (field) {
1054
1074
  return !props.multiLine ? (React__default["default"].createElement("input", __assign({ id: props.name, "data-testid": props.name }, field, { type: "text" }, props.inputProps, { onChange: function (event) {
1055
1075
  var _a;
@@ -1085,6 +1105,7 @@ var LuiFormikTextInput = formik.connect(function (props) {
1085
1105
 
1086
1106
  var LuiFormikRadioButton = function (props) {
1087
1107
  var _a = formik.useField(props), field = _a[0], meta = _a[1];
1108
+ useDeprecatedWarning('LuiFormikRadioButton');
1088
1109
  return (React__default["default"].createElement("div", { className: props.className },
1089
1110
  meta.touched && meta.error && (React__default["default"].createElement("i", { className: "lui-form-status-icon material-icons-round" }, "error")),
1090
1111
  React__default["default"].createElement("div", { className: 'lui-radio-container' },
@@ -1233,6 +1254,7 @@ var LuiFormikRadioGroup = function (props) {
1233
1254
  var error = formik.getIn(ctx.errors, props.name);
1234
1255
  var touch = formik.getIn(ctx.touched, props.name);
1235
1256
  var showError = touch && error;
1257
+ useDeprecatedWarning('LuiFormikRadioGroup');
1236
1258
  var describedby = props.hint && camelcase(props === null || props === void 0 ? void 0 : props.hint) + 'Id';
1237
1259
  var errorDescribedBy = error && camelcase(error) + 'Id';
1238
1260
  return (React__default["default"].createElement("div", { className: clsx('lui-fieldsetBlock-form-group', showError && 'lui-input-error') },
@@ -1248,10 +1270,12 @@ var LuiFormikRadioGroup = function (props) {
1248
1270
  };
1249
1271
 
1250
1272
  var LuiFormikFormSubmitButton = formik.connect(function (props) {
1273
+ useDeprecatedWarning('LuiFormikFormSubmitButton');
1251
1274
  return (React__default["default"].createElement(LuiButton, { type: "submit", className: props.className, level: "primary", "data-testid": props['data-testid'], disabled: !!props.disabled }, props.children));
1252
1275
  });
1253
1276
 
1254
1277
  var LuiFormikSelect = formik.connect(function (props) {
1278
+ useDeprecatedWarning('LuiFormikSelect');
1255
1279
  var error = formik.getIn(props.formik.errors, props.name);
1256
1280
  var touch = formik.getIn(props.formik.touched, props.name);
1257
1281
  var showError = touch && error;