@widergy/energy-ui 3.81.1 → 3.82.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.82.1](https://github.com/widergy/energy-ui/compare/v3.82.0...v3.82.1) (2025-06-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGMC-1052] value on top ([#627](https://github.com/widergy/energy-ui/issues/627)) ([1c6fbe9](https://github.com/widergy/energy-ui/commit/1c6fbe947bffc6209c22327f262a40319dabe385))
7
+
8
+ # [3.82.0](https://github.com/widergy/energy-ui/compare/v3.81.1...v3.82.0) (2025-06-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * [OUG-8696] added unmaskcsc prop to credit card ([#626](https://github.com/widergy/energy-ui/issues/626)) ([69976f9](https://github.com/widergy/energy-ui/commit/69976f9385f502fb0c66303968ac630b4fcc4310))
14
+
1
15
  ## [3.81.1](https://github.com/widergy/energy-ui/compare/v3.81.0...v3.81.1) (2025-06-09)
2
16
 
3
17
 
@@ -120,7 +120,7 @@ const Bars = _ref => {
120
120
  fill: data.onTopLabelColor,
121
121
  x: xInitialPosition + barWidth / 2,
122
122
  y: yInitialPosition - (spacingOptions.onTopLabelPadding || _constants.DEFAULT_TOP_LABEL_PADDING)
123
- }, data.onTopLabel || value), borderSelector && /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("rect", {
123
+ }, data.onTopLabel || (value > 0 ? value : '')), borderSelector && /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("rect", {
124
124
  fill: "transparent",
125
125
  height: graphYStart + graphYEnd / 2 + ((borderSelector === null || borderSelector === void 0 ? void 0 : borderSelector.heightOffset) || 0),
126
126
  rx: borderSelector === null || borderSelector === void 0 ? void 0 : borderSelector.radius,
@@ -19,6 +19,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
19
19
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
20
20
  const UTBaseInputField = _ref => {
21
21
  let {
22
+ autocomplete,
22
23
  classes: theme,
23
24
  classNames = {},
24
25
  dataKeyboard,
@@ -32,6 +33,7 @@ const UTBaseInputField = _ref => {
32
33
  maxRows = 1,
33
34
  minRows,
34
35
  muiProps,
36
+ name,
35
37
  onBlur,
36
38
  onChange = () => {},
37
39
  onFocus,
@@ -88,7 +90,7 @@ const UTBaseInputField = _ref => {
88
90
  })) : null;
89
91
  }, [error, disabled, readOnly, focused]);
90
92
  return /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({
91
- autocomplete: "new-password",
93
+ autocomplete: autocomplete || 'new-password',
92
94
  className: classes.container,
93
95
  disabled: disabled || readOnly,
94
96
  error: error,
@@ -112,9 +114,11 @@ const UTBaseInputField = _ref => {
112
114
  }, muiProps, {
113
115
  InputProps: {
114
116
  inputProps: {
117
+ autocomplete,
115
118
  'data-testid': dataTestId,
116
119
  'data-keyboard': dataKeyboard,
117
120
  maxLength,
121
+ name,
118
122
  readOnly,
119
123
  ...(muiProps === null || muiProps === void 0 ? void 0 : muiProps.inputProps)
120
124
  },
@@ -141,6 +145,7 @@ const UTBaseInputField = _ref => {
141
145
  };
142
146
  const propTypes = exports.propTypes = {
143
147
  alwaysShowPlaceholder: _propTypes.bool,
148
+ autocomplete: _propTypes.string,
144
149
  classes: (0, _propTypes.objectOf)(_propTypes.string),
145
150
  classNames: (0, _propTypes.objectOf)(_propTypes.string),
146
151
  dataKeyboard: _propTypes.string,
@@ -162,6 +167,7 @@ const propTypes = exports.propTypes = {
162
167
  inputProps: _propTypes.object,
163
168
  InputProps: _propTypes.object
164
169
  }),
170
+ name: _propTypes.string,
165
171
  onBlur: _propTypes.func,
166
172
  onChange: _propTypes.func,
167
173
  onFocus: _propTypes.func,
@@ -6,11 +6,12 @@
6
6
 
7
7
  ## Props
8
8
 
9
- | Name | Type | Default | Description |
10
- | ----------- | ----------- | ------- | --------------------------------------------------------------------------- |
11
- | `value` | object | | The current value of the component, usually an object representing the state. |
12
- | `onChange` | func | | A required function that is called when the value changes. |
13
- | `childKeys` | array | | An array of keys to access child elements or properties in the `value` object. |
14
- | `error` | string | | Error message to display when there is a validation issue. |
15
- | `texts` | object | | An object containing various text strings used within the component |
16
- | `className` | string | | Custom class name to apply to the root element of the component. |
9
+ | Name | Type | Default | Description |
10
+ | ----------- | ----------- | ------- | ------------------------------------------------------------------------------------------------------ |
11
+ | `childKeys` | array | | An array of keys to access child elements or properties in the `value` object. |
12
+ | `className` | string | | Custom class name to apply to the root element of the component. |
13
+ | `error` | string | | Error message to display when there is a validation issue. |
14
+ | `onChange` | func | | A required function that is called when the value changes. |
15
+ | `texts` | object | | An object containing various text strings used within the component |
16
+ | `unmaskCsc` | bool | false | Displays the CSC field as a normal text input. If false, the CSC field is displayed as a password. `If "true", the telemetryScrubber must be configured in the project's rollbar configuration to prevent this field value from being tracked.` |
17
+ | `value` | object | | The current value of the component, usually an object representing the state. |
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
10
10
  var _UTPasswordField = _interopRequireDefault(require("../UTPasswordField"));
11
11
  var _UTTextInput = _interopRequireDefault(require("../UTTextInput"));
12
12
  var _testIds = require("../../constants/testIds");
13
+ var _inputs = require("../../constants/inputs");
13
14
  require("react-credit-cards/es/styles-compiled.css");
14
15
  var _constants = require("./constants");
15
16
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
@@ -33,6 +34,7 @@ const UTCreditCard = _ref => {
33
34
  nameTitle,
34
35
  numberTitle
35
36
  } = _constants.DEFAULT_TEXTS,
37
+ unmaskCsc,
36
38
  value = {}
37
39
  } = _ref;
38
40
  const [cardField, nameFiled, cvcField, expMonthField, expYearField, expires] = childKeys;
@@ -69,10 +71,11 @@ const UTCreditCard = _ref => {
69
71
  field,
70
72
  newVal
71
73
  });
74
+ const CSVComponent = unmaskCsc ? _UTTextInput.default : _UTPasswordField.default;
72
75
  return /*#__PURE__*/_react.default.createElement("div", {
73
76
  className: "".concat(_stylesModule.default.container, " ").concat(className)
74
77
  }, /*#__PURE__*/_react.default.createElement(_reactCreditCards.default, {
75
- cvc: cvcVisibility ? values[cvcField] : values[cvcField].replace(/./g, '*'),
78
+ cvc: cvcVisibility || unmaskCsc ? values[cvcField] : values[cvcField].replace(/./g, '*'),
76
79
  expiry: values.expiry,
77
80
  focused: focused,
78
81
  locale: {
@@ -86,8 +89,10 @@ const UTCreditCard = _ref => {
86
89
  }), /*#__PURE__*/_react.default.createElement("div", {
87
90
  className: _stylesModule.default.fields
88
91
  }, /*#__PURE__*/_react.default.createElement(_UTTextInput.default, {
92
+ autocomplete: "cc-number",
89
93
  dataTestId: creditCard.cardField,
90
94
  error: errors[cardField],
95
+ name: _inputs.CREDIT_CARD_NAMES.cardNumber,
91
96
  onChange: onChangeField(cardField),
92
97
  onFocus: () => setFocused(_constants.fields.NUMBER),
93
98
  required: true,
@@ -98,11 +103,13 @@ const UTCreditCard = _ref => {
98
103
  }), /*#__PURE__*/_react.default.createElement("div", {
99
104
  className: _stylesModule.default.row
100
105
  }, /*#__PURE__*/_react.default.createElement(_UTTextInput.default, {
106
+ autocomplete: "cc-exp",
101
107
  classNames: {
102
108
  container: _stylesModule.default.inRow
103
109
  },
104
110
  dataTestId: creditCard.expires,
105
111
  error: errors[expires],
112
+ name: _inputs.CREDIT_CARD_NAMES.cardExpDate,
106
113
  onChange: onChangeField(expires),
107
114
  onFocus: () => setFocused(_constants.fields.EXPIRY),
108
115
  required: true,
@@ -110,23 +117,27 @@ const UTCreditCard = _ref => {
110
117
  validationDataTestId: "".concat(creditCard.expires, ".validation"),
111
118
  value: values[expires],
112
119
  version: "V1"
113
- }), /*#__PURE__*/_react.default.createElement(_UTPasswordField.default, {
120
+ }), /*#__PURE__*/_react.default.createElement(CSVComponent, {
121
+ autocomplete: unmaskCsc ? 'cc-csc' : 'off',
114
122
  classNames: {
115
123
  container: _stylesModule.default.inRow
116
124
  },
117
125
  dataTestId: creditCard.cvcField,
118
126
  error: errors[cvcField],
127
+ name: _inputs.CREDIT_CARD_NAMES.cardCvc,
119
128
  onChange: onChangeField(cvcField),
129
+ onFocus: () => setFocused(_constants.fields.CVC),
120
130
  onVisibilityToggle: setCvcVisibility,
121
- title: cvcTitle,
122
131
  required: true,
123
- onFocus: () => setFocused(_constants.fields.CVC),
132
+ title: cvcTitle,
124
133
  validationDataTestId: "".concat(creditCard.cvcField, ".validation"),
125
134
  value: values[cvcField],
126
135
  version: "V1"
127
136
  })), /*#__PURE__*/_react.default.createElement(_UTTextInput.default, {
137
+ autocomplete: "cc-name",
128
138
  dataTestId: creditCard.nameField,
129
139
  error: errors[nameFiled],
140
+ name: _inputs.CREDIT_CARD_NAMES.cardName,
130
141
  onChange: onChangeField(nameFiled),
131
142
  required: true,
132
143
  onFocus: () => setFocused(_constants.fields.NAME),
@@ -137,11 +148,12 @@ const UTCreditCard = _ref => {
137
148
  })));
138
149
  };
139
150
  UTCreditCard.propTypes = {
140
- value: _propTypes.object,
141
- onChange: _propTypes.func,
142
151
  childKeys: _propTypes.array,
152
+ className: _propTypes.string,
143
153
  error: _propTypes.object,
154
+ onChange: _propTypes.func,
144
155
  texts: _propTypes.object,
145
- className: _propTypes.string
156
+ unmaskCsc: _propTypes.bool,
157
+ value: _propTypes.object
146
158
  };
147
159
  var _default = exports.default = UTCreditCard;
@@ -8,9 +8,10 @@
8
8
 
9
9
 
10
10
  | Name | Type | Default | Description |
11
- | :---------------------- | ----------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------- |
11
+ | --------------------- | --------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
12
12
  | action | object | | Configuration for the action button that appears at the end of the input. |
13
13
  | alwaysShowPlaceholder | bool | false | Whether the placeholder should always be displayed, even when the input is focused. |
14
+ | autocomplete | string | | Indicates the type of values ​​that are expected as a value. Enables the browser to offer suggestions |
14
15
  | blurOnSubmit | bool | false | Whether the input should lose focus after submitting (e.g., after pressing "Enter"). |
15
16
  | classNames | objectOf(string) | | Additional classes for customizing the component, independent of Material-UI. |
16
17
  | dataTestId | string | | Identifier for the input field, useful for testing purposes. |
@@ -22,6 +23,7 @@
22
23
  | inputSize | string | 'large' | Size of the input field. One of:`small`, `large`. |
23
24
  | maxLength | number | | Maximum number of characters allowed in the input field. |
24
25
  | maxRows | number | 1 | Maximum number of rows the text area can display. If greater than 1, the input becomes a text area. |
26
+ | name | string | | Name of the field. Native attribute of the html input element.
25
27
  | onBlur | func | | Function called when the input field loses focus. |
26
28
  | onChange | func | | Function called when the input field value changes. |
27
29
  | onFocus | func | | Function called when the input field gains focus. |
@@ -47,7 +49,7 @@ The `action` object allows configuring the action button that appears inside the
47
49
 
48
50
 
49
51
  | Name | Type | Description |
50
- | ---------- | ------------- | ---------------------------------------------------- |
52
+ | -------- | ----------- | -------------------------------------------------- |
51
53
  | icon | elementType | Icon to be displayed in the action button. |
52
54
  | onClick | func | Function called when the action button is clicked. |
53
55
  | disabled | bool | Disables the action button. |
@@ -23,6 +23,7 @@ const UTTextInput = _ref => {
23
23
  actions: titleActions,
24
24
  actionDataTestId,
25
25
  alwaysShowPlaceholder,
26
+ autocomplete,
26
27
  classNames = {},
27
28
  dataTestId,
28
29
  disabled,
@@ -37,6 +38,7 @@ const UTTextInput = _ref => {
37
38
  maxLength,
38
39
  maxRows = 1,
39
40
  minRows,
41
+ name,
40
42
  onBlur,
41
43
  onChange = () => {},
42
44
  onFocus,
@@ -117,6 +119,7 @@ const UTTextInput = _ref => {
117
119
  size: titleVariant
118
120
  }, title), /*#__PURE__*/_react.default.createElement(_UTBaseInputField.default, {
119
121
  alwaysShowPlaceholder: alwaysShowPlaceholder,
122
+ autocomplete: autocomplete,
120
123
  classNames: classNames,
121
124
  dataTestId: dataTestId,
122
125
  disabled: disabled,
@@ -128,6 +131,7 @@ const UTTextInput = _ref => {
128
131
  maxLength: maxLength,
129
132
  maxRows: maxRows,
130
133
  minRows: minRows,
134
+ name: name,
131
135
  onBlur: onBlur,
132
136
  onChange: onChange,
133
137
  onFocus: onFocus,
@@ -154,6 +158,7 @@ const propTypes = exports.propTypes = {
154
158
  actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
155
159
  actionDataTestId: _propTypes.string,
156
160
  alwaysShowPlaceholder: _propTypes.bool,
161
+ autocomplete: _propTypes.string,
157
162
  classNames: (0, _propTypes.objectOf)(_propTypes.string),
158
163
  dataTestId: _propTypes.string,
159
164
  disabled: _propTypes.bool,
@@ -170,6 +175,7 @@ const propTypes = exports.propTypes = {
170
175
  maxLength: _propTypes.number,
171
176
  minRows: _propTypes.number,
172
177
  maxRows: _propTypes.number,
178
+ name: _propTypes.string,
173
179
  onBlur: _propTypes.func,
174
180
  onChange: _propTypes.func,
175
181
  onFocus: _propTypes.func,
@@ -3,8 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TITLE_VARIANTS = void 0;
6
+ exports.TITLE_VARIANTS = exports.CREDIT_CARD_NAMES_PREFIX = exports.CREDIT_CARD_NAMES = void 0;
7
7
  const TITLE_VARIANTS = exports.TITLE_VARIANTS = {
8
8
  large: 'body',
9
9
  small: 'small'
10
+ };
11
+ const CREDIT_CARD_NAMES_PREFIX = exports.CREDIT_CARD_NAMES_PREFIX = 'creditCard';
12
+ const CREDIT_CARD_NAMES = exports.CREDIT_CARD_NAMES = {
13
+ cardCvc: "".concat(CREDIT_CARD_NAMES_PREFIX, "Cvc"),
14
+ cardExpDate: "".concat(CREDIT_CARD_NAMES_PREFIX, "ExpDate"),
15
+ cardName: "".concat(CREDIT_CARD_NAMES_PREFIX, "Name"),
16
+ cardNumber: "".concat(CREDIT_CARD_NAMES_PREFIX, "Number")
10
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.81.1",
3
+ "version": "3.82.1",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",