@rhc-shared-components/form-group-container 0.3.2 → 1.0.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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
+ import { ValidatedOptions } from '@patternfly/react-core';
2
3
  interface FormGroupContainerProps {
3
- isValid?: boolean;
4
4
  helperTextInvalid?: string;
5
5
  fieldId: string;
6
6
  label?: string;
@@ -9,7 +9,7 @@ interface FormGroupContainerProps {
9
9
  className?: string;
10
10
  isRequired?: boolean;
11
11
  helperText?: string;
12
- validated?: any;
12
+ validated?: ValidatedOptions;
13
13
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
14
14
  }
15
15
  declare const FormGroupContainer: React.FC<FormGroupContainerProps>;
package/dist/index.js CHANGED
@@ -36,14 +36,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
36
36
  return target;
37
37
  }
38
38
 
39
- var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-c-form__helper-text--FontSize);\n margin-top: var(--pf-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-c-form--m-error--Color);\n}";
39
+ var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-v5-c-form__helper-text--FontSize);\n margin-top: var(--pf-v5-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-v5-c-form--m-error--Color);\n}";
40
40
 
41
- var _excluded = ["children", "helperTextInvalid", "isValid", "helperText", "labelIcon", "onClick"];
41
+ var _excluded = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
42
42
 
43
43
  var FormGroupContainer = function FormGroupContainer(_ref) {
44
44
  var children = _ref.children,
45
45
  helperTextInvalid = _ref.helperTextInvalid,
46
- isValid = _ref.isValid,
46
+ validated = _ref.validated,
47
47
  helperText = _ref.helperText,
48
48
  labelIcon = _ref.labelIcon,
49
49
  onClick = _ref.onClick,
@@ -51,15 +51,14 @@ var FormGroupContainer = function FormGroupContainer(_ref) {
51
51
 
52
52
  InsertCss();
53
53
  return React__namespace.createElement(reactCore.FormGroup, Object.assign({
54
- className: 'form-group',
55
- helperTextInvalid: helperTextInvalid,
56
- helperText: helperText,
57
- validated: isValid ? reactCore.ValidatedOptions["default"] : reactCore.ValidatedOptions.error
54
+ className: 'form-group'
58
55
  }, labelIcon && {
59
56
  labelIcon: labelIcon
60
57
  }, onClick && {
61
58
  onClick: onClick
62
- }, rest), children);
59
+ }, rest), children, React__namespace.createElement(reactCore.FormHelperText, null, React__namespace.createElement(reactCore.HelperText, null, React__namespace.createElement(reactCore.HelperTextItem, {
60
+ variant: validated
61
+ }, reactCore.ValidatedOptions.error ? helperTextInvalid : helperText))));
63
62
  };
64
63
 
65
64
  var InsertCss = function InsertCss() {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormGroup, ValidatedOptions } from '@patternfly/react-core';
2
+ import { FormGroup, FormHelperText, HelperText, HelperTextItem, ValidatedOptions } from '@patternfly/react-core';
3
3
 
4
4
  function _objectWithoutPropertiesLoose(source, excluded) {
5
5
  if (source == null) return {};
@@ -16,15 +16,15 @@ function _objectWithoutPropertiesLoose(source, excluded) {
16
16
  return target;
17
17
  }
18
18
 
19
- var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-c-form__helper-text--FontSize);\n margin-top: var(--pf-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-c-form--m-error--Color);\n}";
19
+ var css_248z = ".form-group .max-char-length {\n float: right;\n color: #6A6E73;\n font-size: var(--pf-v5-c-form__helper-text--FontSize);\n margin-top: var(--pf-v5-c-form__helper-text--MarginTop);\n}\n.form-group .maxlength-error {\n color: var(--pf-v5-c-form--m-error--Color);\n}";
20
20
 
21
- const _excluded = ["children", "helperTextInvalid", "isValid", "helperText", "labelIcon", "onClick"];
21
+ const _excluded = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
22
22
 
23
23
  const FormGroupContainer = _ref => {
24
24
  let {
25
25
  children,
26
26
  helperTextInvalid,
27
- isValid,
27
+ validated,
28
28
  helperText,
29
29
  labelIcon,
30
30
  onClick
@@ -33,15 +33,14 @@ const FormGroupContainer = _ref => {
33
33
 
34
34
  InsertCss();
35
35
  return React.createElement(FormGroup, Object.assign({
36
- className: 'form-group',
37
- helperTextInvalid: helperTextInvalid,
38
- helperText: helperText,
39
- validated: isValid ? ValidatedOptions.default : ValidatedOptions.error
36
+ className: 'form-group'
40
37
  }, labelIcon && {
41
38
  labelIcon: labelIcon
42
39
  }, onClick && {
43
40
  onClick
44
- }, rest), children);
41
+ }, rest), children, React.createElement(FormHelperText, null, React.createElement(HelperText, null, React.createElement(HelperTextItem, {
42
+ variant: validated
43
+ }, ValidatedOptions.error ? helperTextInvalid : helperText))));
45
44
  };
46
45
 
47
46
  const InsertCss = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/form-group-container",
3
- "version": "0.3.2",
3
+ "version": "1.0.0",
4
4
  "description": "Form group container for Red Hat certified technology apps",
5
5
  "author": "gautamkrishnar",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "dist"
66
66
  ],
67
67
  "dependencies": {
68
- "@patternfly/react-core": "^4.276.6",
68
+ "@patternfly/react-core": "^5.3.1",
69
69
  "formik": "^2.1.4",
70
70
  "react": "^16.13.1",
71
71
  "react-dom": "^16.13.1"