@linzjs/lui 15.1.0 → 15.1.3

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.3](https://github.com/linz/lui/compare/v15.1.2...v15.1.3) (2022-03-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added Hot Pink to the colour palette ([#600](https://github.com/linz/lui/issues/600)) ([a09285e](https://github.com/linz/lui/commit/a09285e1d5bdc80771beb1fecbc9232e289267f4))
7
+
8
+ ## [15.1.2](https://github.com/linz/lui/compare/v15.1.1...v15.1.2) (2022-03-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Deprecated Formik coupled inputs ([#586](https://github.com/linz/lui/issues/586)) ([d05916f](https://github.com/linz/lui/commit/d05916ff803d145310e82c494a9414cd01a2750d))
14
+
15
+ ## [15.1.1](https://github.com/linz/lui/compare/v15.1.0...v15.1.1) (2022-03-02)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Changes the labels on LuiCheckboxInput to regular ([#597](https://github.com/linz/lui/issues/597)) ([2812b72](https://github.com/linz/lui/commit/2812b72c08c19af6dedd9d305333d8073f2724ce))
21
+
1
22
  # [15.1.0](https://github.com/linz/lui/compare/v15.0.7...v15.1.0) (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
 
@@ -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);
@@ -867,10 +876,14 @@ var LuiCheckboxInput = function (props) {
867
876
  return (React__default["default"].createElement("div", { className: clsx('LuiCheckboxInput', {
868
877
  'LuiCheckboxInput--isChecked': props.isChecked,
869
878
  'LuiCheckboxInput--hasError': !!props.error,
879
+ 'LuiCheckboxInput--isDisabled': !!props.isDisabled,
870
880
  }) },
871
881
  React__default["default"].createElement("label", { htmlFor: id, className: "LuiCheckboxInput-group" },
872
882
  React__default["default"].createElement("input", __assign({ className: clsx('LuiCheckboxInput-input'), id: id, type: "checkbox", value: props.value, onChange: props.onChange, checked: props.isChecked, disabled: props.isDisabled }, props.inputProps)),
873
- React__default["default"].createElement("span", { className: "LuiCheckboxInput-label" }, props.label)),
883
+ React__default["default"].createElement("span", { className: "LuiCheckboxInput-label" },
884
+ props.label,
885
+ ' ',
886
+ React__default["default"].createElement(LuiIcon, { name: "ic_check", size: "md", alt: "Check", className: "LuiCheckboxInput-labelCheck" }))),
874
887
  props.error && (React__default["default"].createElement(LuiError, { className: "LuiCheckboxInput", error: props.error }))));
875
888
  };
876
889
 
@@ -1020,6 +1033,7 @@ var LuiRadioInput = function (props) {
1020
1033
  };
1021
1034
 
1022
1035
  function LuiFormikCheckbox(props) {
1036
+ useDeprecatedWarning('LuiFormikCheckbox');
1023
1037
  var ctx = formik.useFormikContext();
1024
1038
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1025
1039
  React__default["default"].createElement(formik.Field, { name: props.name }, function (_a) {
@@ -1034,18 +1048,22 @@ function LuiFormikCheckbox(props) {
1034
1048
  })));
1035
1049
  }
1036
1050
 
1037
- var LuiFormikFormLabel = function (props) { return (React__default["default"].createElement("div", { className: clsx('LuiFormLabel-wrapper', props.className && "" + props.className) },
1038
- props.children,
1039
- React__default["default"].createElement("label", { className: "LuiFormLabel", htmlFor: props["for"] },
1040
- props.required && React__default["default"].createElement("span", { className: "lui-required-input-icon" }, "*"),
1041
- props.label),
1042
- 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
+ };
1043
1060
 
1044
1061
  var LuiFormikTextInput = formik.connect(function (props) {
1045
1062
  var error = formik.getIn(props.formik.errors, props.name);
1046
1063
  var touch = formik.getIn(props.formik.touched, props.name);
1047
1064
  var showError = touch && error;
1048
1065
  var setFieldValue = formik.useFormikContext().setFieldValue;
1066
+ useDeprecatedWarning('LuiFormikTextInput');
1049
1067
  var multiLineToggle = function (field) {
1050
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) {
1051
1069
  var _a;
@@ -1081,6 +1099,7 @@ var LuiFormikTextInput = formik.connect(function (props) {
1081
1099
 
1082
1100
  var LuiFormikRadioButton = function (props) {
1083
1101
  var _a = formik.useField(props), field = _a[0], meta = _a[1];
1102
+ useDeprecatedWarning('LuiFormikRadioButton');
1084
1103
  return (React__default["default"].createElement("div", { className: props.className },
1085
1104
  meta.touched && meta.error && (React__default["default"].createElement("i", { className: "lui-form-status-icon material-icons-round" }, "error")),
1086
1105
  React__default["default"].createElement("div", { className: 'lui-radio-container' },
@@ -1229,6 +1248,7 @@ var LuiFormikRadioGroup = function (props) {
1229
1248
  var error = formik.getIn(ctx.errors, props.name);
1230
1249
  var touch = formik.getIn(ctx.touched, props.name);
1231
1250
  var showError = touch && error;
1251
+ useDeprecatedWarning('LuiFormikRadioGroup');
1232
1252
  var describedby = props.hint && camelcase(props === null || props === void 0 ? void 0 : props.hint) + 'Id';
1233
1253
  var errorDescribedBy = error && camelcase(error) + 'Id';
1234
1254
  return (React__default["default"].createElement("div", { className: clsx('lui-fieldsetBlock-form-group', showError && 'lui-input-error') },
@@ -1244,10 +1264,12 @@ var LuiFormikRadioGroup = function (props) {
1244
1264
  };
1245
1265
 
1246
1266
  var LuiFormikFormSubmitButton = formik.connect(function (props) {
1267
+ useDeprecatedWarning('LuiFormikFormSubmitButton');
1247
1268
  return (React__default["default"].createElement(LuiButton, { type: "submit", className: props.className, level: "primary", "data-testid": props['data-testid'], disabled: !!props.disabled }, props.children));
1248
1269
  });
1249
1270
 
1250
1271
  var LuiFormikSelect = formik.connect(function (props) {
1272
+ useDeprecatedWarning('LuiFormikSelect');
1251
1273
  var error = formik.getIn(props.formik.errors, props.name);
1252
1274
  var touch = formik.getIn(props.formik.touched, props.name);
1253
1275
  var showError = touch && error;