@linzjs/lui 15.1.1 → 15.1.2

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.2](https://github.com/linz/lui/compare/v15.1.1...v15.1.2) (2022-03-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Deprecated Formik coupled inputs ([#586](https://github.com/linz/lui/issues/586)) ([d05916f](https://github.com/linz/lui/commit/d05916ff803d145310e82c494a9414cd01a2750d))
7
+
1
8
  ## [15.1.1](https://github.com/linz/lui/compare/v15.1.0...v15.1.1) (2022-03-02)
2
9
 
3
10
 
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
 
@@ -0,0 +1 @@
1
+ export declare function useDeprecatedWarning(componentName: string): void;
package/dist/index.js CHANGED
@@ -468,7 +468,16 @@ var LuiTabsPanelSwitch = function (props) {
468
468
  } }, props.children));
469
469
  };
470
470
 
471
+ function useDeprecatedWarning(componentName) {
472
+ React.useEffect(function () {
473
+ if (window.location.hostname.includes('localhost')) {
474
+ console.warn(componentName + " will be deprecated in future versions of Lui. Please see the 'Current Deprecations' page in Lui docs.");
475
+ }
476
+ }, []);
477
+ }
478
+
471
479
  function LuiFormikForm(props) {
480
+ useDeprecatedWarning('LuiFormikForm');
472
481
  // this spreads all keys, except className
473
482
  var _a = __assign({}, props); _a.className; var formikProps = __rest(_a, ["className"]);
474
483
  var classNames = clsx(props.className);
@@ -1024,6 +1033,7 @@ var LuiRadioInput = function (props) {
1024
1033
  };
1025
1034
 
1026
1035
  function LuiFormikCheckbox(props) {
1036
+ useDeprecatedWarning('LuiFormikCheckbox');
1027
1037
  var ctx = formik.useFormikContext();
1028
1038
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1029
1039
  React__default["default"].createElement(formik.Field, { name: props.name }, function (_a) {
@@ -1038,18 +1048,22 @@ function LuiFormikCheckbox(props) {
1038
1048
  })));
1039
1049
  }
1040
1050
 
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"))); };
1051
+ var LuiFormikFormLabel = function (props) {
1052
+ useDeprecatedWarning('LuiFormikFormLabel');
1053
+ return (React__default["default"].createElement("div", { className: clsx('LuiFormLabel-wrapper', props.className && "" + props.className) },
1054
+ props.children,
1055
+ React__default["default"].createElement("label", { className: "LuiFormLabel", htmlFor: props["for"] },
1056
+ props.required && React__default["default"].createElement("span", { className: "lui-required-input-icon" }, "*"),
1057
+ props.label),
1058
+ props.tooltip && React__default["default"].createElement("i", { className: "material-icons-round" }, "help")));
1059
+ };
1047
1060
 
1048
1061
  var LuiFormikTextInput = formik.connect(function (props) {
1049
1062
  var error = formik.getIn(props.formik.errors, props.name);
1050
1063
  var touch = formik.getIn(props.formik.touched, props.name);
1051
1064
  var showError = touch && error;
1052
1065
  var setFieldValue = formik.useFormikContext().setFieldValue;
1066
+ useDeprecatedWarning('LuiFormikTextInput');
1053
1067
  var multiLineToggle = function (field) {
1054
1068
  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
1069
  var _a;
@@ -1085,6 +1099,7 @@ var LuiFormikTextInput = formik.connect(function (props) {
1085
1099
 
1086
1100
  var LuiFormikRadioButton = function (props) {
1087
1101
  var _a = formik.useField(props), field = _a[0], meta = _a[1];
1102
+ useDeprecatedWarning('LuiFormikRadioButton');
1088
1103
  return (React__default["default"].createElement("div", { className: props.className },
1089
1104
  meta.touched && meta.error && (React__default["default"].createElement("i", { className: "lui-form-status-icon material-icons-round" }, "error")),
1090
1105
  React__default["default"].createElement("div", { className: 'lui-radio-container' },
@@ -1233,6 +1248,7 @@ var LuiFormikRadioGroup = function (props) {
1233
1248
  var error = formik.getIn(ctx.errors, props.name);
1234
1249
  var touch = formik.getIn(ctx.touched, props.name);
1235
1250
  var showError = touch && error;
1251
+ useDeprecatedWarning('LuiFormikRadioGroup');
1236
1252
  var describedby = props.hint && camelcase(props === null || props === void 0 ? void 0 : props.hint) + 'Id';
1237
1253
  var errorDescribedBy = error && camelcase(error) + 'Id';
1238
1254
  return (React__default["default"].createElement("div", { className: clsx('lui-fieldsetBlock-form-group', showError && 'lui-input-error') },
@@ -1248,10 +1264,12 @@ var LuiFormikRadioGroup = function (props) {
1248
1264
  };
1249
1265
 
1250
1266
  var LuiFormikFormSubmitButton = formik.connect(function (props) {
1267
+ useDeprecatedWarning('LuiFormikFormSubmitButton');
1251
1268
  return (React__default["default"].createElement(LuiButton, { type: "submit", className: props.className, level: "primary", "data-testid": props['data-testid'], disabled: !!props.disabled }, props.children));
1252
1269
  });
1253
1270
 
1254
1271
  var LuiFormikSelect = formik.connect(function (props) {
1272
+ useDeprecatedWarning('LuiFormikSelect');
1255
1273
  var error = formik.getIn(props.formik.errors, props.name);
1256
1274
  var touch = formik.getIn(props.formik.touched, props.name);
1257
1275
  var showError = touch && error;