@rhc-shared-components/form-group-container 0.4.0 → 1.0.1

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
@@ -38,12 +38,12 @@ function _objectWithoutPropertiesLoose(source, excluded) {
38
38
 
39
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
- validated: isValid ? reactCore.ValidatedOptions["default"] : reactCore.ValidatedOptions.error
54
+ className: 'form-group'
56
55
  }, labelIcon && {
57
56
  labelIcon: labelIcon
58
57
  }, onClick && {
59
58
  onClick: onClick
60
59
  }, rest), children, React__namespace.createElement(reactCore.FormHelperText, null, React__namespace.createElement(reactCore.HelperText, null, React__namespace.createElement(reactCore.HelperTextItem, {
61
- variant: isValid ? reactCore.ValidatedOptions["default"] : reactCore.ValidatedOptions.error
62
- }, isValid ? helperText : helperTextInvalid))));
60
+ variant: validated
61
+ }, validated === 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, FormHelperText, HelperText, HelperTextItem } 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 {};
@@ -18,13 +18,13 @@ function _objectWithoutPropertiesLoose(source, excluded) {
18
18
 
19
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
- validated: isValid ? ValidatedOptions.default : ValidatedOptions.error
36
+ className: 'form-group'
38
37
  }, labelIcon && {
39
38
  labelIcon: labelIcon
40
39
  }, onClick && {
41
40
  onClick
42
41
  }, rest), children, React.createElement(FormHelperText, null, React.createElement(HelperText, null, React.createElement(HelperTextItem, {
43
- variant: isValid ? ValidatedOptions.default : ValidatedOptions.error
44
- }, isValid ? helperText : helperTextInvalid))));
42
+ variant: validated
43
+ }, validated === 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.4.0",
3
+ "version": "1.0.1",
4
4
  "description": "Form group container for Red Hat certified technology apps",
5
5
  "author": "gautamkrishnar",
6
6
  "license": "MIT",