react-restyle-components 0.1.44 → 0.1.45

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 (127) hide show
  1. package/lib/cjs/App.js +36 -12
  2. package/lib/cjs/App.test.js +10 -8
  3. package/lib/cjs/core-components/atoms/buttons/button.stories.js +26 -24
  4. package/lib/cjs/core-components/atoms/buttons/buttons.component.js +27 -9
  5. package/lib/cjs/core-components/atoms/buttons/buttons.test.js +15 -7
  6. package/lib/cjs/core-components/atoms/check-box/checkBox.component.js +102 -35
  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 +15 -7
  9. package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js +98 -37
  10. package/lib/cjs/core-components/atoms/date-picker/date-picker.stories.js +17 -15
  11. package/lib/cjs/core-components/atoms/date-picker/date-picker.test.js +16 -7
  12. package/lib/cjs/core-components/atoms/form/form.component.js +571 -159
  13. package/lib/cjs/core-components/atoms/form/form.test.js +87 -59
  14. package/lib/cjs/core-components/atoms/icons/icons.component.js +40 -26
  15. package/lib/cjs/core-components/atoms/input/input-otp.component.js +118 -76
  16. package/lib/cjs/core-components/atoms/input/input-pin.component.js +180 -98
  17. package/lib/cjs/core-components/atoms/input/input-pin.stories.js +14 -14
  18. package/lib/cjs/core-components/atoms/input/input-pin.test.js +28 -10
  19. package/lib/cjs/core-components/atoms/input/input.component.js +104 -33
  20. package/lib/cjs/core-components/atoms/input/input.stories.js +15 -15
  21. package/lib/cjs/core-components/atoms/input/input.test.js +30 -10
  22. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js +127 -53
  23. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.stories.js +12 -12
  24. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.test.js +16 -7
  25. package/lib/cjs/core-components/atoms/loader/loader.component.js +83 -21
  26. package/lib/cjs/core-components/atoms/loader/loader.stories.js +8 -8
  27. package/lib/cjs/core-components/atoms/loader/loader.test.js +11 -7
  28. package/lib/cjs/core-components/atoms/radio/radio.component.js +102 -37
  29. package/lib/cjs/core-components/atoms/radio/radio.stories.js +16 -16
  30. package/lib/cjs/core-components/atoms/radio/radio.test.js +15 -7
  31. package/lib/cjs/core-components/atoms/stepper/stepper.component.js +77 -34
  32. package/lib/cjs/core-components/atoms/stepper/stepper.stories.js +13 -13
  33. package/lib/cjs/core-components/atoms/stepper/stepper.test.js +16 -7
  34. package/lib/cjs/core-components/atoms/stepper/stepper.test.js.map +1 -1
  35. package/lib/cjs/core-components/atoms/tabs/tabs.component.js +95 -0
  36. package/lib/cjs/core-components/atoms/tabs/tabs.component.js.map +1 -0
  37. package/lib/cjs/core-components/atoms/tabs/tabs.stories.js +26 -0
  38. package/lib/cjs/core-components/atoms/tabs/tabs.stories.js.map +1 -0
  39. package/lib/cjs/core-components/atoms/tabs/tabs.test.js +26 -0
  40. package/lib/cjs/core-components/atoms/tabs/tabs.test.js.map +1 -0
  41. package/lib/cjs/core-components/atoms/timer/timer.component.js +119 -92
  42. package/lib/cjs/core-components/atoms/timer/timer.test.js +20 -10
  43. package/lib/cjs/core-components/atoms/tooltip/tooltip.component.js +85 -45
  44. package/lib/cjs/core-components/atoms/tooltip/tooltip.component.test.js +13 -9
  45. package/lib/cjs/core-components/atoms/tooltip/tooltip.stories.js +8 -8
  46. package/lib/cjs/core-components/index.js +65 -27
  47. package/lib/cjs/core-components/index.js.map +1 -1
  48. package/lib/cjs/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +210 -106
  49. 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 +23 -9
  50. package/lib/cjs/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.js +38 -36
  51. package/lib/cjs/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +209 -104
  52. 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 +28 -16
  53. package/lib/cjs/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.js +24 -22
  54. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.component.js +203 -106
  55. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.stories.js +8 -8
  56. package/lib/cjs/core-components/molecules/css-multiline-input/css-multiline-input.test.js +14 -7
  57. package/lib/cjs/core-components/molecules/css-multiline-input/css-properties.js +159 -159
  58. package/lib/cjs/core-utils/index.js +31 -15
  59. package/lib/cjs/core-utils/unit-test.utils.js +8 -6
  60. package/lib/cjs/index.js +31 -15
  61. package/lib/cjs/library/assets/svg/index.js +39 -13
  62. package/lib/cjs/reportWebVitals.js +1 -1
  63. package/lib/cjs/setupTests.js +1 -1
  64. package/lib/esm/App.js +34 -12
  65. package/lib/esm/App.test.js +8 -8
  66. package/lib/esm/core-components/atoms/buttons/button.stories.js +24 -24
  67. package/lib/esm/core-components/atoms/buttons/buttons.component.js +23 -7
  68. package/lib/esm/core-components/atoms/buttons/buttons.test.js +13 -7
  69. package/lib/esm/core-components/atoms/check-box/checkBox.component.js +65 -19
  70. package/lib/esm/core-components/atoms/check-box/checkBox.stories.js +18 -18
  71. package/lib/esm/core-components/atoms/check-box/checkBox.test.js +13 -7
  72. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js +54 -21
  73. package/lib/esm/core-components/atoms/date-picker/date-picker.stories.js +14 -14
  74. package/lib/esm/core-components/atoms/date-picker/date-picker.test.js +15 -8
  75. package/lib/esm/core-components/atoms/form/form.component.js +513 -138
  76. package/lib/esm/core-components/atoms/form/form.test.js +78 -60
  77. package/lib/esm/core-components/atoms/icons/icons.component.js +36 -24
  78. package/lib/esm/core-components/atoms/input/input-otp.component.js +80 -59
  79. package/lib/esm/core-components/atoms/input/input-pin.component.js +142 -81
  80. package/lib/esm/core-components/atoms/input/input-pin.stories.js +15 -15
  81. package/lib/esm/core-components/atoms/input/input-pin.test.js +26 -10
  82. package/lib/esm/core-components/atoms/input/input.component.js +66 -16
  83. package/lib/esm/core-components/atoms/input/input.stories.js +16 -16
  84. package/lib/esm/core-components/atoms/input/input.test.js +28 -10
  85. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js +95 -36
  86. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.stories.js +13 -13
  87. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.test.js +14 -7
  88. package/lib/esm/core-components/atoms/loader/loader.component.js +80 -20
  89. package/lib/esm/core-components/atoms/loader/loader.stories.js +9 -9
  90. package/lib/esm/core-components/atoms/loader/loader.test.js +7 -7
  91. package/lib/esm/core-components/atoms/radio/radio.component.js +65 -21
  92. package/lib/esm/core-components/atoms/radio/radio.stories.js +17 -17
  93. package/lib/esm/core-components/atoms/radio/radio.test.js +13 -7
  94. package/lib/esm/core-components/atoms/stepper/stepper.component.js +74 -32
  95. package/lib/esm/core-components/atoms/stepper/stepper.stories.js +14 -14
  96. package/lib/esm/core-components/atoms/stepper/stepper.test.js +14 -7
  97. package/lib/esm/core-components/atoms/stepper/stepper.test.js.map +1 -1
  98. package/lib/esm/core-components/atoms/tabs/tabs.component.js +47 -0
  99. package/lib/esm/core-components/atoms/tabs/tabs.component.js.map +1 -0
  100. package/lib/esm/core-components/atoms/tabs/tabs.stories.js +23 -0
  101. package/lib/esm/core-components/atoms/tabs/tabs.stories.js.map +1 -0
  102. package/lib/esm/core-components/atoms/tabs/tabs.test.js +19 -0
  103. package/lib/esm/core-components/atoms/tabs/tabs.test.js.map +1 -0
  104. package/lib/esm/core-components/atoms/timer/timer.component.js +81 -75
  105. package/lib/esm/core-components/atoms/timer/timer.test.js +10 -10
  106. package/lib/esm/core-components/atoms/tooltip/tooltip.component.js +46 -25
  107. package/lib/esm/core-components/atoms/tooltip/tooltip.component.test.js +9 -9
  108. package/lib/esm/core-components/atoms/tooltip/tooltip.stories.js +9 -9
  109. package/lib/esm/core-components/index.js +19 -18
  110. package/lib/esm/core-components/index.js.map +1 -1
  111. package/lib/esm/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +170 -88
  112. 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 +17 -9
  113. package/lib/esm/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.js +38 -37
  114. package/lib/esm/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +169 -86
  115. 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 +22 -16
  116. package/lib/esm/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.js +24 -23
  117. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.component.js +166 -90
  118. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.stories.js +9 -9
  119. package/lib/esm/core-components/molecules/css-multiline-input/css-multiline-input.test.js +9 -7
  120. package/lib/esm/core-components/molecules/css-multiline-input/css-properties.js +159 -159
  121. package/lib/esm/core-utils/index.js +2 -2
  122. package/lib/esm/core-utils/unit-test.utils.js +5 -5
  123. package/lib/esm/index.js +2 -2
  124. package/lib/esm/library/assets/svg/index.js +19 -10
  125. package/lib/esm/reportWebVitals.js +1 -1
  126. package/lib/esm/setupTests.js +2 -2
  127. package/package.json +3 -1
@@ -1,111 +1,193 @@
1
1
  "use strict";
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) {
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) {
19
37
  if (mod && mod.__esModule) return mod;
20
38
  var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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);
22
43
  __setModuleDefault(result, mod);
23
44
  return result;
24
- };
45
+ };
25
46
  Object.defineProperty(exports, "__esModule", { value: true });
26
47
  exports.InputPin = void 0;
27
48
  /* eslint-disable */
28
49
  const react_1 = __importStar(require("react"));
29
50
  require("./input.styles.css");
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) => {
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) => {
52
131
  var _a;
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 || ''}`))));
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
+ );
109
191
  };
110
192
  exports.InputPin = InputPin;
111
- //# sourceMappingURL=input-pin.component.js.map
193
+ //# 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 });
21
- },
15
+ args: {
16
+ title: "Enter your Aadhaar Number",
17
+ hasError: true,
18
+ defaultPin: [],
19
+ onPinChanged: (item) => {
20
+ console.log({ item });
22
21
  },
22
+ },
23
23
  };
24
- //# sourceMappingURL=input-pin.stories.js.map
24
+ //# sourceMappingURL=input-pin.stories.js.map
@@ -1,18 +1,36 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  /* eslint-disable testing-library/render-result-naming-convention */
7
9
  const react_1 = __importDefault(require("react"));
8
10
  const _core_utils_1 = require("@core-utils");
9
11
  const input_pin_component_1 = require("./input-pin.component");
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();
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();
13
23
  });
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();
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();
17
35
  });
18
- //# sourceMappingURL=input-pin.test.js.map
36
+ //# sourceMappingURL=input-pin.test.js.map
@@ -1,45 +1,116 @@
1
1
  "use strict";
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) {
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) {
19
37
  if (mod && mod.__esModule) return mod;
20
38
  var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
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);
22
43
  __setModuleDefault(result, mod);
23
44
  return result;
24
- };
45
+ };
25
46
  Object.defineProperty(exports, "__esModule", { value: true });
26
47
  exports.Input = void 0;
27
48
  /* eslint-disable no-console */
28
49
  const react_1 = __importStar(require("react"));
29
50
  require("./input.styles.css");
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 || ''}`))));
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
+ );
43
114
  };
44
115
  exports.Input = Input;
45
- //# sourceMappingURL=input.component.js.map
116
+ //# 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 });
19
- },
20
- onBlur: (item) => {
21
- console.log({ item });
22
- },
12
+ args: {
13
+ className: "mt-4",
14
+ title: "Enter your Pan Number",
15
+ hasError: true,
16
+ defaultValue: "",
17
+ onChange: (item) => {
18
+ console.log({ item });
23
19
  },
20
+ onBlur: (item) => {
21
+ console.log({ item });
22
+ },
23
+ },
24
24
  };
25
- //# sourceMappingURL=input.stories.js.map
25
+ //# sourceMappingURL=input.stories.js.map
@@ -1,18 +1,38 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  /* eslint-disable testing-library/render-result-naming-convention */
7
9
  const react_1 = __importDefault(require("react"));
8
10
  const _core_utils_1 = require("@core-utils");
9
11
  const input_component_1 = require("./input.component");
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();
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();
13
24
  });
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();
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();
17
37
  });
18
- //# sourceMappingURL=input.test.js.map
38
+ //# sourceMappingURL=input.test.js.map