react-restyle-components 0.1.45 → 0.1.46

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.
Files changed (140) hide show
  1. package/lib/cjs/App.js +12 -36
  2. package/lib/cjs/App.test.js +8 -10
  3. package/lib/cjs/core-components/atoms/buttons/button.stories.js +24 -26
  4. package/lib/cjs/core-components/atoms/buttons/buttons.component.js +9 -27
  5. package/lib/cjs/core-components/atoms/buttons/buttons.test.js +7 -15
  6. package/lib/cjs/core-components/atoms/check-box/checkBox.component.js +35 -102
  7. package/lib/cjs/core-components/atoms/check-box/checkBox.stories.js +17 -17
  8. package/lib/cjs/core-components/atoms/check-box/checkBox.test.js +7 -15
  9. package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js +37 -98
  10. package/lib/cjs/core-components/atoms/date-picker/date-picker.stories.js +15 -17
  11. package/lib/cjs/core-components/atoms/date-picker/date-picker.test.js +7 -16
  12. package/lib/cjs/core-components/atoms/form/form.component.js +159 -571
  13. package/lib/cjs/core-components/atoms/form/form.test.js +59 -87
  14. package/lib/cjs/core-components/atoms/icons/icons.component.js +58 -41
  15. package/lib/cjs/core-components/atoms/icons/icons.component.js.map +1 -1
  16. package/lib/cjs/core-components/atoms/icons/icons.stories.js +23 -0
  17. package/lib/cjs/core-components/atoms/icons/icons.stories.js.map +1 -0
  18. package/lib/cjs/core-components/atoms/icons/icons.test.js +16 -0
  19. package/lib/cjs/core-components/atoms/icons/icons.test.js.map +1 -0
  20. package/lib/cjs/core-components/atoms/input/input-otp.component.js +76 -118
  21. package/lib/cjs/core-components/atoms/input/input-pin.component.js +98 -180
  22. package/lib/cjs/core-components/atoms/input/input-pin.stories.js +14 -14
  23. package/lib/cjs/core-components/atoms/input/input-pin.test.js +10 -28
  24. package/lib/cjs/core-components/atoms/input/input.component.js +33 -104
  25. package/lib/cjs/core-components/atoms/input/input.stories.js +15 -15
  26. package/lib/cjs/core-components/atoms/input/input.test.js +10 -30
  27. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js +53 -127
  28. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.stories.js +12 -12
  29. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.test.js +7 -16
  30. package/lib/cjs/core-components/atoms/loader/loader.component.js +21 -83
  31. package/lib/cjs/core-components/atoms/loader/loader.stories.js +8 -8
  32. package/lib/cjs/core-components/atoms/loader/loader.test.js +7 -11
  33. package/lib/cjs/core-components/atoms/radio/radio.component.js +37 -102
  34. package/lib/cjs/core-components/atoms/radio/radio.stories.js +16 -16
  35. package/lib/cjs/core-components/atoms/radio/radio.test.js +7 -15
  36. package/lib/cjs/core-components/atoms/stepper/stepper.component.js +34 -77
  37. package/lib/cjs/core-components/atoms/stepper/stepper.stories.js +13 -13
  38. package/lib/cjs/core-components/atoms/stepper/stepper.test.js +7 -16
  39. package/lib/cjs/core-components/atoms/tabs/tabs.component.js +32 -81
  40. package/lib/cjs/core-components/atoms/tabs/tabs.stories.js +16 -16
  41. package/lib/cjs/core-components/atoms/tabs/tabs.stories.js.map +1 -1
  42. package/lib/cjs/core-components/atoms/tabs/tabs.test.js +13 -20
  43. package/lib/cjs/core-components/atoms/timer/timer.component.js +92 -119
  44. package/lib/cjs/core-components/atoms/timer/timer.test.js +10 -20
  45. package/lib/cjs/core-components/atoms/tooltip/tooltip.component.js +45 -85
  46. package/lib/cjs/core-components/atoms/tooltip/tooltip.component.test.js +9 -13
  47. package/lib/cjs/core-components/atoms/tooltip/tooltip.stories.js +8 -8
  48. package/lib/cjs/core-components/index.js +27 -64
  49. package/lib/cjs/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +106 -210
  50. package/lib/cjs/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.test.js +9 -23
  51. package/lib/cjs/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.js +36 -38
  52. package/lib/cjs/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +104 -209
  53. package/lib/cjs/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.test.js +16 -28
  54. package/lib/cjs/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.js +22 -24
  55. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.component.js +106 -203
  56. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.stories.js +8 -8
  57. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.test.js +7 -14
  58. package/lib/cjs/core-components/molecules/css-multiline-input/css-properties.js +159 -159
  59. package/lib/cjs/core-utils/index.js +15 -31
  60. package/lib/cjs/core-utils/unit-test.utils.js +6 -8
  61. package/lib/cjs/index.js +15 -31
  62. package/lib/cjs/library/assets/svg/DownArrow.svg +14 -0
  63. package/lib/cjs/library/assets/svg/UpArrow.svg +14 -0
  64. package/lib/cjs/library/assets/svg/checkedBox.svg +14 -0
  65. package/lib/cjs/library/assets/svg/checkedRadio.svg +13 -0
  66. package/lib/cjs/library/assets/svg/datePicker.svg +3 -0
  67. package/lib/cjs/library/assets/svg/index.js +13 -39
  68. package/lib/cjs/library/assets/svg/index.ts +38 -0
  69. package/lib/cjs/library/assets/svg/timer copy.svg +3 -0
  70. package/lib/cjs/library/assets/svg/timer.svg +3 -0
  71. package/lib/cjs/library/assets/svg/unCheckbox.svg +3 -0
  72. package/lib/cjs/library/assets/svg/uncheckRadio.svg +3 -0
  73. package/lib/cjs/reportWebVitals.js +1 -1
  74. package/lib/cjs/setupTests.js +1 -1
  75. package/lib/esm/App.js +12 -34
  76. package/lib/esm/App.test.js +8 -8
  77. package/lib/esm/core-components/atoms/buttons/button.stories.js +24 -24
  78. package/lib/esm/core-components/atoms/buttons/buttons.component.js +7 -23
  79. package/lib/esm/core-components/atoms/buttons/buttons.test.js +7 -13
  80. package/lib/esm/core-components/atoms/check-box/checkBox.component.js +19 -65
  81. package/lib/esm/core-components/atoms/check-box/checkBox.stories.js +18 -18
  82. package/lib/esm/core-components/atoms/check-box/checkBox.test.js +7 -13
  83. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js +21 -54
  84. package/lib/esm/core-components/atoms/date-picker/date-picker.stories.js +14 -14
  85. package/lib/esm/core-components/atoms/date-picker/date-picker.test.js +8 -15
  86. package/lib/esm/core-components/atoms/form/form.component.js +138 -513
  87. package/lib/esm/core-components/atoms/form/form.test.js +60 -78
  88. package/lib/esm/core-components/atoms/icons/icons.component.js +32 -36
  89. package/lib/esm/core-components/atoms/icons/icons.component.js.map +1 -1
  90. package/lib/esm/core-components/atoms/icons/icons.stories.js +20 -0
  91. package/lib/esm/core-components/atoms/icons/icons.stories.js.map +1 -0
  92. package/lib/esm/core-components/atoms/icons/icons.test.js +11 -0
  93. package/lib/esm/core-components/atoms/icons/icons.test.js.map +1 -0
  94. package/lib/esm/core-components/atoms/input/input-otp.component.js +59 -80
  95. package/lib/esm/core-components/atoms/input/input-pin.component.js +81 -142
  96. package/lib/esm/core-components/atoms/input/input-pin.stories.js +15 -15
  97. package/lib/esm/core-components/atoms/input/input-pin.test.js +10 -26
  98. package/lib/esm/core-components/atoms/input/input.component.js +16 -66
  99. package/lib/esm/core-components/atoms/input/input.stories.js +16 -16
  100. package/lib/esm/core-components/atoms/input/input.test.js +10 -28
  101. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js +36 -95
  102. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.stories.js +13 -13
  103. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.test.js +7 -14
  104. package/lib/esm/core-components/atoms/loader/loader.component.js +20 -80
  105. package/lib/esm/core-components/atoms/loader/loader.stories.js +9 -9
  106. package/lib/esm/core-components/atoms/loader/loader.test.js +7 -7
  107. package/lib/esm/core-components/atoms/radio/radio.component.js +21 -65
  108. package/lib/esm/core-components/atoms/radio/radio.stories.js +17 -17
  109. package/lib/esm/core-components/atoms/radio/radio.test.js +7 -13
  110. package/lib/esm/core-components/atoms/stepper/stepper.component.js +32 -74
  111. package/lib/esm/core-components/atoms/stepper/stepper.stories.js +14 -14
  112. package/lib/esm/core-components/atoms/stepper/stepper.test.js +7 -14
  113. package/lib/esm/core-components/atoms/tabs/tabs.component.js +15 -43
  114. package/lib/esm/core-components/atoms/tabs/tabs.stories.js +17 -17
  115. package/lib/esm/core-components/atoms/tabs/tabs.stories.js.map +1 -1
  116. package/lib/esm/core-components/atoms/tabs/tabs.test.js +13 -18
  117. package/lib/esm/core-components/atoms/timer/timer.component.js +75 -81
  118. package/lib/esm/core-components/atoms/timer/timer.test.js +10 -10
  119. package/lib/esm/core-components/atoms/tooltip/tooltip.component.js +25 -46
  120. package/lib/esm/core-components/atoms/tooltip/tooltip.component.test.js +9 -9
  121. package/lib/esm/core-components/atoms/tooltip/tooltip.stories.js +9 -9
  122. package/lib/esm/core-components/index.js +19 -19
  123. package/lib/esm/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +88 -170
  124. package/lib/esm/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.test.js +9 -17
  125. package/lib/esm/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.js +37 -38
  126. package/lib/esm/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +86 -169
  127. package/lib/esm/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.test.js +16 -22
  128. package/lib/esm/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.js +23 -24
  129. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.component.js +90 -166
  130. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.stories.js +9 -9
  131. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.test.js +7 -9
  132. package/lib/esm/core-components/molecules/css-multiline-input/css-properties.js +159 -159
  133. package/lib/esm/core-utils/index.js +2 -2
  134. package/lib/esm/core-utils/unit-test.utils.js +5 -5
  135. package/lib/esm/index.js +2 -2
  136. package/lib/esm/library/assets/svg/index.js +10 -19
  137. package/lib/esm/reportWebVitals.js +1 -1
  138. package/lib/esm/setupTests.js +2 -2
  139. package/lib/package.json +125 -0
  140. package/package.json +3 -2
@@ -1,193 +1,111 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __setModuleDefault =
26
- (this && this.__setModuleDefault) ||
27
- (Object.create
28
- ? function (o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }
31
- : function (o, v) {
32
- o["default"] = v;
33
- });
34
- var __importStar =
35
- (this && this.__importStar) ||
36
- function (mod) {
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
37
19
  if (mod && mod.__esModule) return mod;
38
20
  var result = {};
39
- if (mod != null)
40
- for (var k in mod)
41
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
- __createBinding(result, mod, k);
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
43
22
  __setModuleDefault(result, mod);
44
23
  return result;
45
- };
24
+ };
46
25
  Object.defineProperty(exports, "__esModule", { value: true });
47
26
  exports.InputPin = void 0;
48
27
  /* eslint-disable */
49
28
  const react_1 = __importStar(require("react"));
50
29
  require("./input.styles.css");
51
- const InputPin = ({
52
- title,
53
- className,
54
- defaultPin,
55
- errorMsg,
56
- defaultMsg,
57
- hasError,
58
- onPinChanged,
59
- }) => {
60
- const pin = (0, react_1.useRef)([]);
61
- const [reload, setReload] = (0, react_1.useState)(false);
62
- const pinLength = 12;
63
- const Pin_Min_Value = 0;
64
- const Pin_Max_Value = 9;
65
- const BACKSPACE_Key = "Backspace";
66
- const inputRefs = (0, react_1.useRef)([]);
67
- const removeValuesFromArray = (valuesArray, value) => {
68
- const valueIndex = valuesArray.findIndex((entry) => entry === value);
69
- if (valueIndex === -1) {
70
- return;
71
- }
72
- valuesArray.splice(valueIndex, 1);
73
- };
74
- const changePinFocus = (pinIndex) => {
75
- const ref = inputRefs.current[pinIndex];
76
- if (ref) {
77
- ref.focus();
78
- }
79
- };
80
- const onChange = (event, index) => {
81
- var _a;
82
- const previousValue = event.target.defaultValue;
83
- const valueArray = event.target.value.split("");
84
- const output = removeValuesFromArray(valueArray, previousValue);
85
- const value = valueArray.pop();
86
- if (!value) {
87
- return;
88
- }
89
- const pinNumber = Number(value);
90
- if (isNaN(pinNumber) || value.length === 0) {
91
- return;
92
- }
93
- pin.current[
94
- (_a = pin.current) === null || _a === void 0 ? void 0 : _a.length
95
- ] = value;
96
- setReload(!reload);
97
- if (pinNumber >= Pin_Min_Value && pinNumber <= Pin_Max_Value) {
98
- onPinChanged(pin.current, index);
99
- if (index < pinLength - 1) {
100
- changePinFocus(index + 1);
101
- }
102
- }
103
- };
104
- const onKeyDown = (event, index) => {
105
- const keyboardKeyCode = event.nativeEvent.code;
106
- if (keyboardKeyCode != BACKSPACE_Key) return;
107
- if (pin.current[index] !== undefined && keyboardKeyCode === BACKSPACE_Key) {
108
- changePinFocus(index - 1);
109
- }
110
- if (pin.current[index] === undefined) {
111
- changePinFocus(index - 1);
112
- } else {
113
- onPinChanged(undefined, index);
114
- }
115
- };
116
- return react_1.default.createElement(
117
- "div",
118
- { className: `${className} relative` },
119
- react_1.default.createElement(
120
- "label",
121
- {
122
- className:
123
- "duration-300 -z-1 origin-0 text-gray-dark-secondary font-nunitoSansRegular text-md",
124
- },
125
- title,
126
- ),
127
- react_1.default.createElement(
128
- "div",
129
- { className: "flex space-x-1" },
130
- Array.from({ length: pinLength }, (_, index) => {
30
+ const InputPin = ({ title, className, defaultPin, errorMsg, defaultMsg, hasError, onPinChanged, }) => {
31
+ const pin = (0, react_1.useRef)([]);
32
+ const [reload, setReload] = (0, react_1.useState)(false);
33
+ const pinLength = 12;
34
+ const Pin_Min_Value = 0;
35
+ const Pin_Max_Value = 9;
36
+ const BACKSPACE_Key = 'Backspace';
37
+ const inputRefs = (0, react_1.useRef)([]);
38
+ const removeValuesFromArray = (valuesArray, value) => {
39
+ const valueIndex = valuesArray.findIndex((entry) => entry === value);
40
+ if (valueIndex === -1) {
41
+ return;
42
+ }
43
+ valuesArray.splice(valueIndex, 1);
44
+ };
45
+ const changePinFocus = (pinIndex) => {
46
+ const ref = inputRefs.current[pinIndex];
47
+ if (ref) {
48
+ ref.focus();
49
+ }
50
+ };
51
+ const onChange = (event, index) => {
131
52
  var _a;
132
- return react_1.default.createElement(
133
- "div",
134
- { className: "flex space-x-1 max-w-full items-stretch", key: index },
135
- react_1.default.createElement("input", {
136
- "data-testid": "inputElementPin",
137
- type: "tel",
138
- className:
139
- "pb-2 block w-4 px-0 mt-0 bg-transparent text-center border-0 border-b z-20 appearance-none rounded-none focus:outline-none focus:ring-0 focus:border-gray-secondary border-gray-secondary font-nunitoSansRegular ",
140
- onKeyUp: (event) => onKeyDown(event, index),
141
- key: index,
142
- onMouseUp: () => {
143
- if (pin.current.join("").length <= 0) {
144
- changePinFocus(0);
145
- }
146
- },
147
- onClick: () => {
148
- if (pin.current.join("").length <= 0) {
149
- onPinChanged(undefined, 0);
150
- }
151
- },
152
- ref: (el) => {
153
- if (el) {
154
- inputRefs.current[index] = el;
155
- }
156
- },
157
- onChange: (event) => onChange(event, index),
158
- value:
159
- ((_a = pin.current[index]) === null || _a === void 0
160
- ? void 0
161
- : _a.toString()) || "",
162
- }),
163
- react_1.default.createElement(
164
- "div",
165
- { className: "invisible" },
166
- (index + 1) % 4 === 0 ? "ss" : null,
167
- ),
168
- );
169
- }),
170
- ),
171
- hasError &&
172
- (hasError === null || hasError === void 0 ? void 0 : hasError.type) !==
173
- "required" &&
174
- react_1.default.createElement(
175
- "span",
176
- {
177
- className: "text-sm text-red text-4xs font-nunitoSansRegular",
178
- id: "error",
179
- },
180
- `${errorMsg || ""}`,
181
- ),
182
- (!hasError ||
183
- (hasError === null || hasError === void 0 ? void 0 : hasError.type) ===
184
- "required") &&
185
- react_1.default.createElement(
186
- "span",
187
- { className: "text-sm text-4xs font-nunitoSansRegular", id: "error" },
188
- `${defaultMsg || ""}`,
189
- ),
190
- );
53
+ const previousValue = event.target.defaultValue;
54
+ const valueArray = event.target.value.split('');
55
+ const output = removeValuesFromArray(valueArray, previousValue);
56
+ const value = valueArray.pop();
57
+ if (!value) {
58
+ return;
59
+ }
60
+ const pinNumber = Number(value);
61
+ if (isNaN(pinNumber) || value.length === 0) {
62
+ return;
63
+ }
64
+ pin.current[(_a = pin.current) === null || _a === void 0 ? void 0 : _a.length] = value;
65
+ setReload(!reload);
66
+ if (pinNumber >= Pin_Min_Value && pinNumber <= Pin_Max_Value) {
67
+ onPinChanged(pin.current, index);
68
+ if (index < pinLength - 1) {
69
+ changePinFocus(index + 1);
70
+ }
71
+ }
72
+ };
73
+ const onKeyDown = (event, index) => {
74
+ const keyboardKeyCode = event.nativeEvent.code;
75
+ if (keyboardKeyCode != BACKSPACE_Key)
76
+ return;
77
+ if (pin.current[index] !== undefined && keyboardKeyCode === BACKSPACE_Key) {
78
+ changePinFocus(index - 1);
79
+ }
80
+ if (pin.current[index] === undefined) {
81
+ changePinFocus(index - 1);
82
+ }
83
+ else {
84
+ onPinChanged(undefined, index);
85
+ }
86
+ };
87
+ return (react_1.default.createElement("div", { className: `${className} relative` },
88
+ react_1.default.createElement("label", { className: "duration-300 -z-1 origin-0 text-gray-dark-secondary font-nunitoSansRegular text-md" }, title),
89
+ react_1.default.createElement("div", { className: "flex space-x-1" }, Array.from({ length: pinLength }, (_, index) => {
90
+ var _a;
91
+ return (react_1.default.createElement("div", { className: "flex space-x-1 max-w-full items-stretch", key: index },
92
+ react_1.default.createElement("input", { "data-testid": "inputElementPin", type: "tel", className: "pb-2 block w-4 px-0 mt-0 bg-transparent text-center border-0 border-b z-20 appearance-none rounded-none focus:outline-none focus:ring-0 focus:border-gray-secondary border-gray-secondary font-nunitoSansRegular ", onKeyUp: (event) => onKeyDown(event, index), key: index, onMouseUp: () => {
93
+ if (pin.current.join('').length <= 0) {
94
+ changePinFocus(0);
95
+ }
96
+ }, onClick: () => {
97
+ if (pin.current.join('').length <= 0) {
98
+ onPinChanged(undefined, 0);
99
+ }
100
+ }, ref: (el) => {
101
+ if (el) {
102
+ inputRefs.current[index] = el;
103
+ }
104
+ }, onChange: (event) => onChange(event, index), value: ((_a = pin.current[index]) === null || _a === void 0 ? void 0 : _a.toString()) || '' }),
105
+ react_1.default.createElement("div", { className: "invisible" }, (index + 1) % 4 === 0 ? 'ss' : null)));
106
+ })),
107
+ hasError && (hasError === null || hasError === void 0 ? void 0 : hasError.type) !== 'required' && (react_1.default.createElement("span", { className: "text-sm text-red text-4xs font-nunitoSansRegular", id: "error" }, `${errorMsg || ''}`)),
108
+ (!hasError || (hasError === null || hasError === void 0 ? void 0 : hasError.type) === 'required') && (react_1.default.createElement("span", { className: "text-sm text-4xs font-nunitoSansRegular", id: "error" }, `${defaultMsg || ''}`))));
191
109
  };
192
110
  exports.InputPin = InputPin;
193
- //# sourceMappingURL=input-pin.component.js.map
111
+ //# sourceMappingURL=input-pin.component.js.map
@@ -3,22 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Primary = void 0;
4
4
  const input_pin_component_1 = require("./input-pin.component");
5
5
  const meta = {
6
- title: "Design System/Atoms/InputPin",
7
- component: input_pin_component_1.InputPin,
8
- tags: ["autodocs"],
9
- parameters: {
10
- componentSubtitle: `import { InputPin } from 'react-restyle-components'`,
11
- },
6
+ title: 'Design System/Atoms/InputPin',
7
+ component: input_pin_component_1.InputPin,
8
+ tags: ['autodocs'],
9
+ parameters: {
10
+ componentSubtitle: `import { InputPin } from 'react-restyle-components'`,
11
+ },
12
12
  };
13
13
  exports.default = meta;
14
14
  exports.Primary = {
15
- args: {
16
- title: "Enter your Aadhaar Number",
17
- hasError: true,
18
- defaultPin: [],
19
- onPinChanged: (item) => {
20
- console.log({ item });
15
+ args: {
16
+ title: 'Enter your Aadhaar Number',
17
+ hasError: true,
18
+ defaultPin: [],
19
+ onPinChanged: (item) => {
20
+ console.log({ item });
21
+ },
21
22
  },
22
- },
23
23
  };
24
- //# sourceMappingURL=input-pin.stories.js.map
24
+ //# sourceMappingURL=input-pin.stories.js.map
@@ -1,36 +1,18 @@
1
1
  "use strict";
2
- var __importDefault =
3
- (this && this.__importDefault) ||
4
- function (mod) {
5
- return mod && mod.__esModule ? mod : { default: mod };
6
- };
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
7
5
  Object.defineProperty(exports, "__esModule", { value: true });
8
6
  /* eslint-disable testing-library/render-result-naming-convention */
9
7
  const react_1 = __importDefault(require("react"));
10
8
  const _core_utils_1 = require("@core-utils");
11
9
  const input_pin_component_1 = require("./input-pin.component");
12
- it("render InputOtp correctly without error", () => {
13
- const pinInput = (0, _core_utils_1.render)(
14
- react_1.default.createElement(input_pin_component_1.InputPin, {
15
- title: "Enter your Aadhaar Number",
16
- hasError: false,
17
- errorMsg: "Uh oh! You\u2019ve entered an invalid aadhaar number",
18
- onPinChanged: () => jest.fn(),
19
- defaultPin: [],
20
- }),
21
- );
22
- expect(pinInput).toMatchSnapshot();
10
+ it('render InputOtp correctly without error', () => {
11
+ const pinInput = (0, _core_utils_1.render)(react_1.default.createElement(input_pin_component_1.InputPin, { title: "Enter your Aadhaar Number", hasError: false, errorMsg: "Uh oh! You\u2019ve entered an invalid aadhaar number", onPinChanged: () => jest.fn(), defaultPin: [] }));
12
+ expect(pinInput).toMatchSnapshot();
23
13
  });
24
- it("render InputOtp correctly with error", () => {
25
- const pinInput = (0, _core_utils_1.render)(
26
- react_1.default.createElement(input_pin_component_1.InputPin, {
27
- title: "Enter your Aadhaar Number",
28
- hasError: true,
29
- errorMsg: "Uh oh! You\u2019ve entered an invalid aadhaar number",
30
- onPinChanged: () => jest.fn(),
31
- defaultPin: [],
32
- }),
33
- );
34
- expect(pinInput).toMatchSnapshot();
14
+ it('render InputOtp correctly with error', () => {
15
+ const pinInput = (0, _core_utils_1.render)(react_1.default.createElement(input_pin_component_1.InputPin, { title: "Enter your Aadhaar Number", hasError: true, errorMsg: "Uh oh! You\u2019ve entered an invalid aadhaar number", onPinChanged: () => jest.fn(), defaultPin: [] }));
16
+ expect(pinInput).toMatchSnapshot();
35
17
  });
36
- //# sourceMappingURL=input-pin.test.js.map
18
+ //# sourceMappingURL=input-pin.test.js.map
@@ -1,116 +1,45 @@
1
1
  "use strict";
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
16
- },
17
- };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }
21
- : function (o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- });
25
- var __setModuleDefault =
26
- (this && this.__setModuleDefault) ||
27
- (Object.create
28
- ? function (o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }
31
- : function (o, v) {
32
- o["default"] = v;
33
- });
34
- var __importStar =
35
- (this && this.__importStar) ||
36
- function (mod) {
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
37
19
  if (mod && mod.__esModule) return mod;
38
20
  var result = {};
39
- if (mod != null)
40
- for (var k in mod)
41
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
42
- __createBinding(result, mod, k);
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
43
22
  __setModuleDefault(result, mod);
44
23
  return result;
45
- };
24
+ };
46
25
  Object.defineProperty(exports, "__esModule", { value: true });
47
26
  exports.Input = void 0;
48
27
  /* eslint-disable no-console */
49
28
  const react_1 = __importStar(require("react"));
50
29
  require("./input.styles.css");
51
- const Input = ({
52
- title,
53
- defaultValue,
54
- className,
55
- disable,
56
- hasError,
57
- errorMsg,
58
- defaultMsg,
59
- inputStyle,
60
- autoComplete,
61
- maxlength = 40,
62
- onChange,
63
- onBlur,
64
- }) => {
65
- const [value, setValue] = (0, react_1.useState)(defaultValue);
66
- const onKeyUpValue = (event) => {
67
- onChange(event.target.value);
68
- };
69
- return react_1.default.createElement(
70
- "div",
71
- { className: `${className} relative` },
72
- react_1.default.createElement("input", {
73
- "data-testid": "inputElement",
74
- type: "text",
75
- name: "name",
76
- value: value,
77
- placeholder: " ",
78
- disabled: disable,
79
- className: `pt-3 pb-2 bg-transparent block w-full px-0 mt-0 rounded-none border-0 border-b appearance-none focus:outline-none focus:ring-0 focus:border-gray-secondary border-gray-secondary font-nunitoSansRegular ${inputStyle}`,
80
- onChange: (e) => {
81
- setValue(e.target.value);
82
- onChange && onChange(e.target.value);
83
- },
84
- onKeyUp: onKeyUpValue,
85
- onBlur: (e) => onBlur && onBlur(e.target.value),
86
- autoComplete: autoComplete,
87
- maxLength: maxlength,
88
- }),
89
- react_1.default.createElement(
90
- "label",
91
- {
92
- className:
93
- "absolute duration-300 top-3 -z-1 origin-0 text-gray-dark-secondary font-nunitoSansRegular text-md",
94
- },
95
- title,
96
- ),
97
- hasError &&
98
- (hasError === null || hasError === void 0 ? void 0 : hasError.type) !==
99
- "required" &&
100
- react_1.default.createElement(
101
- "span",
102
- { className: "text-sm text-red text-4xs", id: "error" },
103
- `${errorMsg || ""}`,
104
- ),
105
- (!hasError ||
106
- (hasError === null || hasError === void 0 ? void 0 : hasError.type) ===
107
- "required") &&
108
- react_1.default.createElement(
109
- "span",
110
- { className: "text-sm text-4xs", id: "error" },
111
- `${defaultMsg || ""}`,
112
- ),
113
- );
30
+ const Input = ({ title, defaultValue, className, disable, hasError, errorMsg, defaultMsg, inputStyle, autoComplete, maxlength = 40, onChange, onBlur, }) => {
31
+ const [value, setValue] = (0, react_1.useState)(defaultValue);
32
+ const onKeyUpValue = (event) => {
33
+ onChange(event.target.value);
34
+ };
35
+ return (react_1.default.createElement("div", { className: `${className} relative` },
36
+ react_1.default.createElement("input", { "data-testid": "inputElement", type: "text", name: "name", value: value, placeholder: " ", disabled: disable, className: `pt-3 pb-2 bg-transparent block w-full px-0 mt-0 rounded-none border-0 border-b appearance-none focus:outline-none focus:ring-0 focus:border-gray-secondary border-gray-secondary font-nunitoSansRegular ${inputStyle}`, onChange: (e) => {
37
+ setValue(e.target.value);
38
+ onChange && onChange(e.target.value);
39
+ }, onKeyUp: onKeyUpValue, onBlur: (e) => onBlur && onBlur(e.target.value), autoComplete: autoComplete, maxLength: maxlength }),
40
+ react_1.default.createElement("label", { className: "absolute duration-300 top-3 -z-1 origin-0 text-gray-dark-secondary font-nunitoSansRegular text-md" }, title),
41
+ hasError && (hasError === null || hasError === void 0 ? void 0 : hasError.type) !== 'required' && (react_1.default.createElement("span", { className: "text-sm text-red text-4xs", id: "error" }, `${errorMsg || ''}`)),
42
+ (!hasError || (hasError === null || hasError === void 0 ? void 0 : hasError.type) === 'required') && (react_1.default.createElement("span", { className: "text-sm text-4xs", id: "error" }, `${defaultMsg || ''}`))));
114
43
  };
115
44
  exports.Input = Input;
116
- //# sourceMappingURL=input.component.js.map
45
+ //# sourceMappingURL=input.component.js.map
@@ -3,23 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Primary = void 0;
4
4
  const input_component_1 = require("./input.component");
5
5
  const meta = {
6
- title: "Design System/Atoms/Input",
7
- component: input_component_1.Input,
8
- tags: ["autodocs"],
6
+ title: 'Design System/Atoms/Input',
7
+ component: input_component_1.Input,
8
+ tags: ['autodocs'],
9
9
  };
10
10
  exports.default = meta;
11
11
  exports.Primary = {
12
- args: {
13
- className: "mt-4",
14
- title: "Enter your Pan Number",
15
- hasError: true,
16
- defaultValue: "",
17
- onChange: (item) => {
18
- console.log({ item });
12
+ args: {
13
+ className: 'mt-4',
14
+ title: 'Enter your Pan Number',
15
+ hasError: true,
16
+ defaultValue: '',
17
+ onChange: (item) => {
18
+ console.log({ item });
19
+ },
20
+ onBlur: (item) => {
21
+ console.log({ item });
22
+ },
19
23
  },
20
- onBlur: (item) => {
21
- console.log({ item });
22
- },
23
- },
24
24
  };
25
- //# sourceMappingURL=input.stories.js.map
25
+ //# sourceMappingURL=input.stories.js.map
@@ -1,38 +1,18 @@
1
1
  "use strict";
2
- var __importDefault =
3
- (this && this.__importDefault) ||
4
- function (mod) {
5
- return mod && mod.__esModule ? mod : { default: mod };
6
- };
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
7
5
  Object.defineProperty(exports, "__esModule", { value: true });
8
6
  /* eslint-disable testing-library/render-result-naming-convention */
9
7
  const react_1 = __importDefault(require("react"));
10
8
  const _core_utils_1 = require("@core-utils");
11
9
  const input_component_1 = require("./input.component");
12
- it("render Input correctly without error", () => {
13
- const input = (0, _core_utils_1.render)(
14
- react_1.default.createElement(input_component_1.Input, {
15
- className: "h-1 relative top-1 border-red-600 border-b-0 dummy",
16
- title: "input",
17
- hasError: false,
18
- defaultValue: "",
19
- inputStyle: " border-b-0 invisible ",
20
- onChange: () => jest.fn(),
21
- }),
22
- );
23
- expect(input).toMatchSnapshot();
10
+ it('render Input correctly without error', () => {
11
+ const input = (0, _core_utils_1.render)(react_1.default.createElement(input_component_1.Input, { className: "h-1 relative top-1 border-red-600 border-b-0 dummy", title: 'input', hasError: false, defaultValue: '', inputStyle: " border-b-0 invisible ", onChange: () => jest.fn() }));
12
+ expect(input).toMatchSnapshot();
24
13
  });
25
- it("render Input correctly with error", () => {
26
- const input = (0, _core_utils_1.render)(
27
- react_1.default.createElement(input_component_1.Input, {
28
- className: "h-1 relative top-1 border-red-600 border-b-0 dummy",
29
- title: "input",
30
- hasError: true,
31
- defaultValue: "",
32
- inputStyle: " border-b-0 invisible ",
33
- onChange: () => jest.fn(),
34
- }),
35
- );
36
- expect(input).toMatchSnapshot();
14
+ it('render Input correctly with error', () => {
15
+ const input = (0, _core_utils_1.render)(react_1.default.createElement(input_component_1.Input, { className: "h-1 relative top-1 border-red-600 border-b-0 dummy", title: 'input', hasError: true, defaultValue: '', inputStyle: " border-b-0 invisible ", onChange: () => jest.fn() }));
16
+ expect(input).toMatchSnapshot();
37
17
  });
38
- //# sourceMappingURL=input.test.js.map
18
+ //# sourceMappingURL=input.test.js.map