@rhc-shared-components/form-group-container 2.0.1 → 3.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,16 +1,16 @@
1
- import * as React from 'react';
2
- import { ValidatedOptions } from '@patternfly/react-core';
3
- interface FormGroupContainerProps {
4
- helperTextInvalid?: string;
5
- fieldId: string;
6
- label?: string;
7
- labelIcon?: any;
8
- children: React.ReactNode;
9
- className?: string;
10
- isRequired?: boolean;
11
- helperText?: string;
12
- validated?: ValidatedOptions;
13
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
14
- }
15
- declare const FormGroupContainer: React.FC<FormGroupContainerProps>;
16
- export { FormGroupContainer };
1
+ import { FC, ReactNode, MouseEvent } from 'react';
2
+ import { ValidatedOptions } from '@patternfly/react-core';
3
+ interface FormGroupContainerProps {
4
+ helperTextInvalid?: string;
5
+ fieldId: string;
6
+ label?: string;
7
+ labelIcon?: any;
8
+ children: ReactNode;
9
+ className?: string;
10
+ isRequired?: boolean;
11
+ helperText?: string;
12
+ validated?: ValidatedOptions;
13
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
14
+ }
15
+ declare const FormGroupContainer: FC<FormGroupContainerProps>;
16
+ export { FormGroupContainer };
package/dist/index.js CHANGED
@@ -1,69 +1,56 @@
1
- var React = require('react');
1
+ var jsxRuntime = require('react/jsx-runtime');
2
2
  var reactCore = require('@patternfly/react-core');
3
3
 
4
- function _interopNamespace(e) {
5
- if (e && e.__esModule) return e;
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n["default"] = e;
19
- return n;
4
+ function _extends() {
5
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
6
+ for (var e = 1; e < arguments.length; e++) {
7
+ var t = arguments[e];
8
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
9
+ }
10
+ return n;
11
+ }, _extends.apply(null, arguments);
20
12
  }
21
-
22
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
23
-
24
- function _objectWithoutPropertiesLoose(source, excluded) {
25
- if (source == null) return {};
26
- var target = {};
27
- var sourceKeys = Object.keys(source);
28
- var key, i;
29
-
30
- for (i = 0; i < sourceKeys.length; i++) {
31
- key = sourceKeys[i];
32
- if (excluded.indexOf(key) >= 0) continue;
33
- target[key] = source[key];
13
+ function _objectWithoutPropertiesLoose(r, e) {
14
+ if (null == r) return {};
15
+ var t = {};
16
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
17
+ if (-1 !== e.indexOf(n)) continue;
18
+ t[n] = r[n];
34
19
  }
35
-
36
- return target;
20
+ return t;
37
21
  }
38
22
 
39
23
  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
24
 
41
25
  var _excluded = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
42
-
43
26
  var FormGroupContainer = function FormGroupContainer(_ref) {
44
27
  var children = _ref.children,
45
- helperTextInvalid = _ref.helperTextInvalid,
46
- validated = _ref.validated,
47
- helperText = _ref.helperText,
48
- labelIcon = _ref.labelIcon,
49
- onClick = _ref.onClick,
50
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
51
-
28
+ helperTextInvalid = _ref.helperTextInvalid,
29
+ validated = _ref.validated,
30
+ helperText = _ref.helperText,
31
+ labelIcon = _ref.labelIcon,
32
+ onClick = _ref.onClick,
33
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
52
34
  InsertCss();
53
- return React__namespace.createElement(reactCore.FormGroup, Object.assign({
35
+ return jsxRuntime.jsxs(reactCore.FormGroup, _extends({
54
36
  className: 'form-group'
55
37
  }, labelIcon && {
56
38
  labelIcon: labelIcon
57
39
  }, onClick && {
58
40
  onClick: onClick
59
- }, rest), children, React__namespace.createElement(reactCore.FormHelperText, null, React__namespace.createElement(reactCore.HelperText, null, React__namespace.createElement(reactCore.HelperTextItem, {
60
- variant: validated
61
- }, validated === reactCore.ValidatedOptions.error ? helperTextInvalid : helperText))));
41
+ }, rest, {
42
+ children: [children, jsxRuntime.jsx(reactCore.FormHelperText, {
43
+ children: jsxRuntime.jsx(reactCore.HelperText, {
44
+ children: jsxRuntime.jsx(reactCore.HelperTextItem, {
45
+ variant: validated,
46
+ children: validated === reactCore.ValidatedOptions.error ? helperTextInvalid : helperText
47
+ })
48
+ })
49
+ })]
50
+ }));
62
51
  };
63
-
64
52
  var InsertCss = function InsertCss() {
65
53
  var styleId = 'form-group-component-style';
66
-
67
54
  if (!document.getElementById(styleId)) {
68
55
  var styleTag = document.createElement('style');
69
56
  styleTag.id = styleId;
@@ -1,51 +1,58 @@
1
- import * as React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { FormGroup, FormHelperText, HelperText, HelperTextItem, ValidatedOptions } from '@patternfly/react-core';
3
3
 
4
- function _objectWithoutPropertiesLoose(source, excluded) {
5
- if (source == null) return {};
6
- var target = {};
7
- var sourceKeys = Object.keys(source);
8
- var key, i;
9
-
10
- for (i = 0; i < sourceKeys.length; i++) {
11
- key = sourceKeys[i];
12
- if (excluded.indexOf(key) >= 0) continue;
13
- target[key] = source[key];
4
+ function _extends() {
5
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
6
+ for (var e = 1; e < arguments.length; e++) {
7
+ var t = arguments[e];
8
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
9
+ }
10
+ return n;
11
+ }, _extends.apply(null, arguments);
12
+ }
13
+ function _objectWithoutPropertiesLoose(r, e) {
14
+ if (null == r) return {};
15
+ var t = {};
16
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
17
+ if (-1 !== e.indexOf(n)) continue;
18
+ t[n] = r[n];
14
19
  }
15
-
16
- return target;
20
+ return t;
17
21
  }
18
22
 
19
23
  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
24
 
21
25
  const _excluded = ["children", "helperTextInvalid", "validated", "helperText", "labelIcon", "onClick"];
22
-
23
26
  const FormGroupContainer = _ref => {
24
27
  let {
25
- children,
26
- helperTextInvalid,
27
- validated,
28
- helperText,
29
- labelIcon,
30
- onClick
31
- } = _ref,
32
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
33
-
28
+ children,
29
+ helperTextInvalid,
30
+ validated,
31
+ helperText,
32
+ labelIcon,
33
+ onClick
34
+ } = _ref,
35
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
34
36
  InsertCss();
35
- return React.createElement(FormGroup, Object.assign({
37
+ return jsxs(FormGroup, _extends({
36
38
  className: 'form-group'
37
39
  }, labelIcon && {
38
40
  labelIcon: labelIcon
39
41
  }, onClick && {
40
42
  onClick
41
- }, rest), children, React.createElement(FormHelperText, null, React.createElement(HelperText, null, React.createElement(HelperTextItem, {
42
- variant: validated
43
- }, validated === ValidatedOptions.error ? helperTextInvalid : helperText))));
43
+ }, rest, {
44
+ children: [children, jsx(FormHelperText, {
45
+ children: jsx(HelperText, {
46
+ children: jsx(HelperTextItem, {
47
+ variant: validated,
48
+ children: validated === ValidatedOptions.error ? helperTextInvalid : helperText
49
+ })
50
+ })
51
+ })]
52
+ }));
44
53
  };
45
-
46
54
  const InsertCss = () => {
47
55
  const styleId = 'form-group-component-style';
48
-
49
56
  if (!document.getElementById(styleId)) {
50
57
  const styleTag = document.createElement('style');
51
58
  styleTag.id = styleId;
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/form-group-container",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "Form group container for Red Hat certified technology apps",
5
5
  "author": "gautamkrishnar",
6
6
  "license": "MIT",
@@ -36,8 +36,8 @@
36
36
  "@testing-library/user-event": "^7.2.1",
37
37
  "@types/jest": "^25.1.4",
38
38
  "@types/node": "^12.12.38",
39
- "@types/react": "^16.9.27",
40
- "@types/react-dom": "^16.9.7",
39
+ "@types/react": "^19.2.0",
40
+ "@types/react-dom": "^19.2.0",
41
41
  "@typescript-eslint/eslint-plugin": "^2.26.0",
42
42
  "@typescript-eslint/parser": "^2.26.0",
43
43
  "babel-eslint": "^10.0.3",
@@ -56,19 +56,19 @@
56
56
  "microbundle": "^0.13.3",
57
57
  "npm-run-all": "^4.1.5",
58
58
  "prettier": "^2.0.4",
59
+ "react": "^19.2.0",
60
+ "react-dom": "^19.2.0",
59
61
  "react-scripts": "^3.4.1",
60
62
  "rimraf": "^3.0.2",
61
63
  "sass": "^1.57.1",
62
- "typescript": "^3.7.5"
64
+ "typescript": "~5.7.2"
63
65
  },
64
66
  "files": [
65
67
  "dist"
66
68
  ],
67
69
  "dependencies": {
68
70
  "@patternfly/react-core": "^5.3.1",
69
- "formik": "^2.1.4",
70
- "react": "^16.13.1",
71
- "react-dom": "^16.13.1"
71
+ "formik": "^2.1.4"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
package/CHANGELOG.md DELETED
@@ -1,130 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.3.1](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.9...@rhc-shared-components/form-group-container@0.3.1) (2022-06-14)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * adding form group styles ([8d861bb](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/8d861bb9f70da2d77345e45c647cf028b9af8add))
12
-
13
-
14
-
15
-
16
-
17
- ## [0.2.9](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.8...@rhc-shared-components/form-group-container@0.2.9) (2021-11-01)
18
-
19
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
20
-
21
-
22
-
23
-
24
-
25
- ## [0.2.8](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.7...@rhc-shared-components/form-group-container@0.2.8) (2021-11-01)
26
-
27
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
28
-
29
-
30
-
31
-
32
-
33
- ## [0.2.7](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.6...@rhc-shared-components/form-group-container@0.2.7) (2021-09-29)
34
-
35
-
36
- ### Bug Fixes
37
-
38
- * migrarting microbundle crl to microbundle ([bbed919](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/bbed919af62f15929a78072b0d60f75ff31c4183))
39
-
40
-
41
-
42
-
43
-
44
- ## [0.2.6](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.5...@rhc-shared-components/form-group-container@0.2.6) (2021-09-22)
45
-
46
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
47
-
48
-
49
-
50
-
51
-
52
- ## [0.2.5](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.4...@rhc-shared-components/form-group-container@0.2.5) (2021-09-20)
53
-
54
-
55
- ### Bug Fixes
56
-
57
- * cleaning deps ([227dc2d](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/227dc2da7dfda53172811ef287840b97cd550681))
58
-
59
-
60
-
61
-
62
-
63
- ## [0.2.4](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.3...@rhc-shared-components/form-group-container@0.2.4) (2021-09-17)
64
-
65
-
66
- ### Bug Fixes
67
-
68
- * added cleaning of dist on prepare ([68e3e76](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/68e3e76f8924cabd581baeace07e9afeef20d36b))
69
-
70
-
71
-
72
-
73
-
74
- ## [0.2.3](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.2...@rhc-shared-components/form-group-container@0.2.3) (2021-09-17)
75
-
76
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
77
-
78
-
79
-
80
-
81
-
82
- ## [0.2.2](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.1...@rhc-shared-components/form-group-container@0.2.2) (2021-09-17)
83
-
84
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
85
-
86
-
87
-
88
-
89
-
90
- ## [0.2.1](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.2.0...@rhc-shared-components/form-group-container@0.2.1) (2021-09-17)
91
-
92
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
93
-
94
-
95
-
96
-
97
-
98
- # [0.2.0](https://gitlab.cee.redhat.com/dxp/customer-portal/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.1.2...@rhc-shared-components/form-group-container@0.2.0) (2021-09-17)
99
-
100
-
101
- ### Features
102
-
103
- * added onClick handler ([fe16865](https://gitlab.cee.redhat.com/dxp/customer-portal/rhc-shared-components/commit/fe16865db144788924efdf29c210e7775bce7edb))
104
-
105
-
106
-
107
-
108
-
109
- ## [0.1.2](https://gitlab.cee.redhat.com/dxp/customer-portal/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.1.1...@rhc-shared-components/form-group-container@0.1.2) (2021-09-16)
110
-
111
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
112
-
113
-
114
-
115
-
116
-
117
- ## [0.1.1](https://gitlab.cee.redhat.com/dxp/customer-portal/rhc-shared-components/compare/@rhc-shared-components/form-group-container@0.1.0...@rhc-shared-components/form-group-container@0.1.1) (2021-09-16)
118
-
119
- **Note:** Version bump only for package @rhc-shared-components/form-group-container
120
-
121
-
122
-
123
-
124
-
125
- # 0.1.0 (2021-09-16)
126
-
127
-
128
- ### Features
129
-
130
- * created from group container shared component ([433141e](https://gitlab.cee.redhat.com/dxp/customer-portal/rhc-shared-components/commit/433141ea9925a1a2113ab1395f185bed12b409a1))