react-restyle-components 0.1.28 → 0.1.31

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 (93) 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 +20 -8
  4. package/lib/cjs/core-components/atoms/buttons/buttons.component.js +17 -6
  5. package/lib/cjs/core-components/atoms/buttons/buttons.component.test.js +15 -7
  6. package/lib/cjs/core-components/atoms/check-box/checkBox.component.js +27 -11
  7. package/lib/cjs/core-components/atoms/check-box/checkBox.component.js.map +1 -1
  8. package/lib/cjs/core-components/atoms/check-box/checkBox.component.test.js +14 -7
  9. package/lib/cjs/core-components/atoms/check-box/checkBox.stories.js +22 -9
  10. package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js +98 -38
  11. package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js.map +1 -1
  12. package/lib/cjs/core-components/atoms/date-picker/date-picker.component.test.js +15 -7
  13. package/lib/cjs/core-components/atoms/date-picker/date-picker.stories.js +18 -8
  14. package/lib/cjs/core-components/atoms/input/input-otp.component.js +119 -77
  15. package/lib/cjs/core-components/atoms/input/input-otp.component.js.map +1 -1
  16. package/lib/cjs/core-components/atoms/input/input-otp.styles.css +35 -0
  17. package/lib/cjs/core-components/atoms/input/input-pin.component.js +174 -94
  18. package/lib/cjs/core-components/atoms/input/input-pin.component.test.js +28 -10
  19. package/lib/cjs/core-components/atoms/input/input-pin.stories.js +17 -9
  20. package/lib/cjs/core-components/atoms/input/input.component.js +65 -13
  21. package/lib/cjs/core-components/atoms/input/input.component.test.js +30 -10
  22. package/lib/cjs/core-components/atoms/input/input.stories.js +16 -7
  23. package/lib/cjs/core-components/atoms/input/input.styles.css +35 -0
  24. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js +134 -58
  25. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js.map +1 -1
  26. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.test.js +16 -7
  27. package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.stories.js +14 -7
  28. package/lib/cjs/core-components/atoms/loader/loader.component.js +83 -21
  29. package/lib/cjs/core-components/atoms/loader/loader.component.test.js +11 -7
  30. package/lib/cjs/core-components/atoms/loader/loader.stories.js +14 -8
  31. package/lib/cjs/core-components/atoms/radio/radio.component.js +22 -8
  32. package/lib/cjs/core-components/atoms/radio/radio.component.js.map +1 -1
  33. package/lib/cjs/core-components/atoms/radio/radio.component.test.js +14 -7
  34. package/lib/cjs/core-components/atoms/radio/radio.stories.js +22 -10
  35. package/lib/cjs/core-components/atoms/stepper/stepper.component.js +77 -34
  36. package/lib/cjs/core-components/atoms/stepper/stepper.component.test.js +16 -7
  37. package/lib/cjs/core-components/atoms/stepper/stepper.stories.js +15 -7
  38. package/lib/cjs/core-components/atoms/timer/timer.component.js +120 -93
  39. package/lib/cjs/core-components/atoms/timer/timer.component.js.map +1 -1
  40. package/lib/cjs/core-components/atoms/timer/timer.component.test.js +20 -10
  41. package/lib/cjs/core-components/index.js +35 -16
  42. package/lib/cjs/core-utils/index.js +31 -15
  43. package/lib/cjs/core-utils/unit-test.utils.js +8 -6
  44. package/lib/cjs/index.js +31 -15
  45. package/lib/cjs/reportWebVitals.js +52 -29
  46. package/lib/cjs/setupTests.js +1 -1
  47. package/lib/esm/App.js +34 -12
  48. package/lib/esm/App.test.js +8 -8
  49. package/lib/esm/core-components/atoms/buttons/button.stories.js +17 -7
  50. package/lib/esm/core-components/atoms/buttons/buttons.component.js +13 -4
  51. package/lib/esm/core-components/atoms/buttons/buttons.component.test.js +13 -7
  52. package/lib/esm/core-components/atoms/check-box/checkBox.component.js +20 -9
  53. package/lib/esm/core-components/atoms/check-box/checkBox.component.js.map +1 -1
  54. package/lib/esm/core-components/atoms/check-box/checkBox.component.test.js +9 -7
  55. package/lib/esm/core-components/atoms/check-box/checkBox.stories.js +16 -8
  56. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js +52 -20
  57. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js.map +1 -1
  58. package/lib/esm/core-components/atoms/date-picker/date-picker.component.test.js +14 -8
  59. package/lib/esm/core-components/atoms/date-picker/date-picker.stories.js +16 -8
  60. package/lib/esm/core-components/atoms/input/input-otp.component.js +80 -59
  61. package/lib/esm/core-components/atoms/input/input-otp.component.js.map +1 -1
  62. package/lib/esm/core-components/atoms/input/input-otp.styles.css +35 -0
  63. package/lib/esm/core-components/atoms/input/input-pin.component.js +136 -77
  64. package/lib/esm/core-components/atoms/input/input-pin.component.test.js +26 -10
  65. package/lib/esm/core-components/atoms/input/input-pin.stories.js +14 -8
  66. package/lib/esm/core-components/atoms/input/input.component.js +62 -12
  67. package/lib/esm/core-components/atoms/input/input.component.test.js +28 -10
  68. package/lib/esm/core-components/atoms/input/input.stories.js +13 -6
  69. package/lib/esm/core-components/atoms/input/input.styles.css +35 -0
  70. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js +96 -37
  71. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js.map +1 -1
  72. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.test.js +14 -7
  73. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.stories.js +11 -6
  74. package/lib/esm/core-components/atoms/loader/loader.component.js +80 -20
  75. package/lib/esm/core-components/atoms/loader/loader.component.test.js +7 -7
  76. package/lib/esm/core-components/atoms/loader/loader.stories.js +11 -7
  77. package/lib/esm/core-components/atoms/radio/radio.component.js +12 -6
  78. package/lib/esm/core-components/atoms/radio/radio.component.js.map +1 -1
  79. package/lib/esm/core-components/atoms/radio/radio.component.test.js +9 -7
  80. package/lib/esm/core-components/atoms/radio/radio.stories.js +16 -9
  81. package/lib/esm/core-components/atoms/stepper/stepper.component.js +74 -32
  82. package/lib/esm/core-components/atoms/stepper/stepper.component.test.js +14 -7
  83. package/lib/esm/core-components/atoms/stepper/stepper.stories.js +12 -6
  84. package/lib/esm/core-components/atoms/timer/timer.component.js +81 -75
  85. package/lib/esm/core-components/atoms/timer/timer.component.js.map +1 -1
  86. package/lib/esm/core-components/atoms/timer/timer.component.test.js +10 -10
  87. package/lib/esm/core-components/index.js +12 -12
  88. package/lib/esm/core-utils/index.js +2 -2
  89. package/lib/esm/core-utils/unit-test.utils.js +5 -5
  90. package/lib/esm/index.js +2 -2
  91. package/lib/esm/reportWebVitals.js +10 -10
  92. package/lib/esm/setupTests.js +2 -2
  93. package/package.json +20 -4
@@ -1,35 +1,77 @@
1
- import React from 'react';
2
- export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, }) => {
3
- const finalClass = `${className} w-full px-4 sm:px-8`;
4
- const progressClass = 'absolute my-4 top-1/2 left-0 h-0.5 transform -translate-y-1/2 bg-orange transition-width ease-in-out duration-500';
5
- const Steps = steps === null || steps === void 0 ? void 0 : steps.map((step, index) => {
6
- let stepClass = 'inline-block transform -translate-x-1/2 pt-1 w-8 h-8 rounded-full text-center';
7
- if (index < currentStep)
1
+ import React from "react";
2
+ export const Stepper = ({
3
+ className = "",
4
+ steps,
5
+ currentStep = 1,
6
+ onStepClick,
7
+ }) => {
8
+ const finalClass = `${className} w-full px-4 sm:px-8`;
9
+ const progressClass =
10
+ "absolute my-4 top-1/2 left-0 h-0.5 transform -translate-y-1/2 bg-orange transition-width ease-in-out duration-500";
11
+ const Steps =
12
+ steps === null || steps === void 0
13
+ ? void 0
14
+ : steps.map((step, index) => {
15
+ let stepClass =
16
+ "inline-block transform -translate-x-1/2 pt-1 w-8 h-8 rounded-full text-center";
17
+ if (index < currentStep)
8
18
  stepClass +=
9
- ' font-medium border border-orange bg-background-secondary text-gray';
10
- else if (index > currentStep)
19
+ " font-medium border border-orange bg-background-secondary text-gray";
20
+ else if (index > currentStep)
11
21
  stepClass +=
12
- ' font-medium border border-gray-dark-secondary text-gray bg-background-secondary';
13
- else if (currentStep === index)
14
- stepClass += ' font-medium bg-orange text-white';
15
- if (typeof onStepClick === 'function')
16
- stepClass += ' cursor-pointer';
17
- return (React.createElement("div", { key: step, style: { left: `${(index / (steps.length - 1)) * 100}%` }, className: "absolute" },
18
- React.createElement("span", { className: `${stepClass} font-nunitoSansRegular text-4xs text-center`, onClick: () => {
19
- if (typeof onStepClick === 'function')
20
- onStepClick(index + 1, step);
21
- } }, step)));
22
- });
23
- return (React.createElement("div", { className: finalClass },
24
- React.createElement("div", { className: "w-full relative" },
25
- React.createElement("div", { className: progressClass, style: {
26
- width: `${(currentStep / (steps.length - 1)) * 100}%`,
27
- } },
28
- React.createElement("div", { className: "w-3 h-3 bg-orange rounded-full absolute right-0 top-1/2 transform translate-x-1/2 -translate-y-1/2" })),
29
- React.createElement("div", { className: 'absolute h-0.5 my-4 top-1/2 left-0 transform -translate-y-1/2 bg-gray-dark-secondary transition-width ease-in-out duration-500', style: {
30
- marginLeft: `${(currentStep / (steps.length - 1)) * 100}%`,
31
- width: `${100 - (currentStep / (steps.length - 1)) * 100}%`,
32
- } })),
33
- React.createElement("div", { className: "relative sm:block" }, Steps)));
22
+ " font-medium border border-gray-dark-secondary text-gray bg-background-secondary";
23
+ else if (currentStep === index)
24
+ stepClass += " font-medium bg-orange text-white";
25
+ if (typeof onStepClick === "function") stepClass += " cursor-pointer";
26
+ return React.createElement(
27
+ "div",
28
+ {
29
+ key: step,
30
+ style: { left: `${(index / (steps.length - 1)) * 100}%` },
31
+ className: "absolute",
32
+ },
33
+ React.createElement(
34
+ "span",
35
+ {
36
+ className: `${stepClass} font-nunitoSansRegular text-4xs text-center`,
37
+ onClick: () => {
38
+ if (typeof onStepClick === "function")
39
+ onStepClick(index + 1, step);
40
+ },
41
+ },
42
+ step
43
+ )
44
+ );
45
+ });
46
+ return React.createElement(
47
+ "div",
48
+ { className: finalClass },
49
+ React.createElement(
50
+ "div",
51
+ { className: "w-full relative" },
52
+ React.createElement(
53
+ "div",
54
+ {
55
+ className: progressClass,
56
+ style: {
57
+ width: `${(currentStep / (steps.length - 1)) * 100}%`,
58
+ },
59
+ },
60
+ React.createElement("div", {
61
+ className:
62
+ "w-3 h-3 bg-orange rounded-full absolute right-0 top-1/2 transform translate-x-1/2 -translate-y-1/2",
63
+ })
64
+ ),
65
+ React.createElement("div", {
66
+ className:
67
+ "absolute h-0.5 my-4 top-1/2 left-0 transform -translate-y-1/2 bg-gray-dark-secondary transition-width ease-in-out duration-500",
68
+ style: {
69
+ marginLeft: `${(currentStep / (steps.length - 1)) * 100}%`,
70
+ width: `${100 - (currentStep / (steps.length - 1)) * 100}%`,
71
+ },
72
+ })
73
+ ),
74
+ React.createElement("div", { className: "relative sm:block" }, Steps)
75
+ );
34
76
  };
35
- //# sourceMappingURL=stepper.component.js.map
77
+ //# sourceMappingURL=stepper.component.js.map
@@ -1,8 +1,15 @@
1
- import React from 'react';
2
- import { render } from '@core-utils';
3
- import { Stepper } from './stepper.component';
4
- it('render XB_Stepper correctly', () => {
5
- const stepper = render(React.createElement(Stepper, { steps: ['1', '2', '3', '4'], currentStep: 3, onStepClick: () => jest.fn(), className: "mt-4" }));
6
- expect(stepper).toMatchSnapshot();
1
+ import React from "react";
2
+ import { render } from "@core-utils";
3
+ import { Stepper } from "./stepper.component";
4
+ it("render XB_Stepper correctly", () => {
5
+ const stepper = render(
6
+ React.createElement(Stepper, {
7
+ steps: ["1", "2", "3", "4"],
8
+ currentStep: 3,
9
+ onStepClick: () => jest.fn(),
10
+ className: "mt-4",
11
+ })
12
+ );
13
+ expect(stepper).toMatchSnapshot();
7
14
  });
8
- //# sourceMappingURL=stepper.component.test.js.map
15
+ //# sourceMappingURL=stepper.component.test.js.map
@@ -1,12 +1,18 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  /* eslint-disable react/jsx-indent-props */
3
- import React from 'react';
4
- import { Stepper } from './stepper.component';
3
+ import React from "react";
4
+ import { Stepper } from "./stepper.component";
5
5
  // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6
6
  export default {
7
- title: 'Atoms/Stepper',
8
- component: Stepper,
7
+ title: "Atoms/Stepper",
8
+ component: Stepper,
9
9
  };
10
10
  // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
11
- export const Primary = () => (React.createElement(Stepper, { steps: ['1', '2', '3', '4'], currentStep: 2, onStepClick: (currentStep, step) => { }, className: "mt-4" }));
12
- //# sourceMappingURL=stepper.stories.js.map
11
+ export const Primary = () =>
12
+ React.createElement(Stepper, {
13
+ steps: ["1", "2", "3", "4"],
14
+ currentStep: 2,
15
+ onStepClick: (currentStep, step) => {},
16
+ className: "mt-4",
17
+ });
18
+ //# sourceMappingURL=stepper.stories.js.map
@@ -1,80 +1,86 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable @typescript-eslint/no-unused-expressions */
3
- import React, { useEffect, useState, useImperativeHandle } from 'react';
4
- import { ReactComponent as TimerSVG } from '../../../library/assets/svg/timer.svg';
3
+ import React, { useEffect, useState, useImperativeHandle } from "react";
4
+ import { ReactComponent as TimerSVG } from "@assets/svg/timer.svg";
5
5
  // eslint-disable-next-line react/display-name
6
6
  export const Timer = React.forwardRef(({ onClear }, ref) => {
7
- const width = 15;
8
- const [minute, setMinute] = useState('00');
9
- const [second, setSecond] = useState('10');
10
- useEffect(() => {
11
- const sec = parseInt(second);
12
- const min = parseInt(minute);
13
- const countDown = setInterval(() => {
14
- if (min === 0 && sec === 0) {
15
- setMinute('00');
16
- setSecond('00');
17
- clearInterval(countDown);
18
- onClear && onClear();
19
- }
20
- else {
21
- let secondstTmp = (sec - 1).toString();
22
- if (secondstTmp.length === 1) {
23
- secondstTmp = '0'.concat(secondstTmp);
24
- }
25
- setSecond(secondstTmp);
26
- if (sec === 0) {
27
- setSecond('59');
28
- const m = (min - 1).toString();
29
- setMinute('0' + m);
30
- }
31
- }
32
- }, 1000);
33
- return () => {
34
- clearInterval(countDown);
35
- };
36
- });
37
- useImperativeHandle(ref, () => ({
38
- updateState() {
39
- setMinute('02');
40
- setSecond('00');
41
- },
42
- resetTimer() {
43
- // eslint-disable-next-line no-console
44
- const sec = parseInt(second);
45
- const min = parseInt(minute === '00' ? '02' : minute);
46
- const countDown = setInterval(() => {
47
- // eslint-disable-next-line no-console
48
- if (min === 0 && sec === 0) {
49
- setMinute('00');
50
- setSecond('00');
51
- clearInterval(countDown);
52
- onClear && onClear();
53
- }
54
- else {
55
- let secondstTmp = (sec - 1).toString();
56
- if (secondstTmp.length === 1) {
57
- secondstTmp = '0'.concat(secondstTmp);
58
- }
59
- setSecond(secondstTmp);
60
- if (sec === 0) {
61
- setSecond('59');
62
- const m = (min - 1).toString();
63
- setMinute('0' + m);
64
- }
65
- }
66
- }, 1000);
67
- return () => {
68
- clearInterval(countDown);
69
- };
70
- },
71
- }));
72
- return (React.createElement("div", { className: "flex flex-row items-center" },
73
- React.createElement(TimerSVG, { width: width, height: width, fill: "#E7503D" }),
74
- React.createElement("div", { className: "ml-2 flex flex-row" },
75
- React.createElement("span", null,
76
- minute,
77
- ":"),
78
- React.createElement("span", null, second))));
7
+ const width = 15;
8
+ const [minute, setMinute] = useState("00");
9
+ const [second, setSecond] = useState("10");
10
+ useEffect(() => {
11
+ const sec = parseInt(second);
12
+ const min = parseInt(minute);
13
+ const countDown = setInterval(() => {
14
+ if (min === 0 && sec === 0) {
15
+ setMinute("00");
16
+ setSecond("00");
17
+ clearInterval(countDown);
18
+ onClear && onClear();
19
+ } else {
20
+ let secondstTmp = (sec - 1).toString();
21
+ if (secondstTmp.length === 1) {
22
+ secondstTmp = "0".concat(secondstTmp);
23
+ }
24
+ setSecond(secondstTmp);
25
+ if (sec === 0) {
26
+ setSecond("59");
27
+ const m = (min - 1).toString();
28
+ setMinute("0" + m);
29
+ }
30
+ }
31
+ }, 1000);
32
+ return () => {
33
+ clearInterval(countDown);
34
+ };
35
+ });
36
+ useImperativeHandle(ref, () => ({
37
+ updateState() {
38
+ setMinute("02");
39
+ setSecond("00");
40
+ },
41
+ resetTimer() {
42
+ // eslint-disable-next-line no-console
43
+ const sec = parseInt(second);
44
+ const min = parseInt(minute === "00" ? "02" : minute);
45
+ const countDown = setInterval(() => {
46
+ // eslint-disable-next-line no-console
47
+ if (min === 0 && sec === 0) {
48
+ setMinute("00");
49
+ setSecond("00");
50
+ clearInterval(countDown);
51
+ onClear && onClear();
52
+ } else {
53
+ let secondstTmp = (sec - 1).toString();
54
+ if (secondstTmp.length === 1) {
55
+ secondstTmp = "0".concat(secondstTmp);
56
+ }
57
+ setSecond(secondstTmp);
58
+ if (sec === 0) {
59
+ setSecond("59");
60
+ const m = (min - 1).toString();
61
+ setMinute("0" + m);
62
+ }
63
+ }
64
+ }, 1000);
65
+ return () => {
66
+ clearInterval(countDown);
67
+ };
68
+ },
69
+ }));
70
+ return React.createElement(
71
+ "div",
72
+ { className: "flex flex-row items-center" },
73
+ React.createElement(TimerSVG, {
74
+ width: width,
75
+ height: width,
76
+ fill: "#E7503D",
77
+ }),
78
+ React.createElement(
79
+ "div",
80
+ { className: "ml-2 flex flex-row" },
81
+ React.createElement("span", null, minute, ":"),
82
+ React.createElement("span", null, second)
83
+ )
84
+ );
79
85
  });
80
- //# sourceMappingURL=timer.component.js.map
86
+ //# sourceMappingURL=timer.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"timer.component.js","sourceRoot":"","sources":["../../../../../src/core-components/atoms/timer/timer.component.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,6DAA6D;AAC7D,OAAO,KAAK,EAAE,EAAC,SAAS,EAAO,QAAQ,EAAE,mBAAmB,EAAC,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAC,cAAc,IAAI,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAMjF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,EAAC,OAAO,EAAa,EAAE,GAAa,EAAE,EAAE;IACvC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,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,EAAE,KAAK,EAAE,IAAI,EAAC,SAAS,GAAG;QACxD,6BAAK,SAAS,EAAC,oBAAoB;YACjC;gBAAO,MAAM;oBAAS;YACtB,kCAAO,MAAM,CAAQ,CACjB,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"timer.component.js","sourceRoot":"","sources":["../../../../../src/core-components/atoms/timer/timer.component.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,6DAA6D;AAC7D,OAAO,KAAK,EAAE,EAAC,SAAS,EAAO,QAAQ,EAAE,mBAAmB,EAAC,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAC,cAAc,IAAI,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAMjE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,EAAC,OAAO,EAAa,EAAE,GAAa,EAAE,EAAE;IACvC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAW,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,GAAG,GAAW,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;YACjC,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE;gBAC1B,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,SAAS,CAAC,IAAI,CAAC,CAAC;gBAChB,aAAa,CAAC,SAAS,CAAC,CAAC;gBACzB,OAAO,IAAI,OAAO,EAAE,CAAC;aACtB;iBAAM;gBACL,IAAI,WAAW,GAAG,CAAC,GAAG,GAAG,CAAC,CA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AC,QAAQ,EAAE,CAAC;oBACvC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC5B,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;qBACvC;oBACD,SAAS,CAAC,WAAW,CAAC,CAAC;oBACvB,IAAI,GAAG,KAAK,CAAC,EAAE;wBACb,SAAS,CAAC,IAAI,CAAC,CAAC;wBAChB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;wBAC/B,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;qBACpB;iBACF;YACH,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,OAAO,GAAG,EAAE;gBACV,aAAa,CAAC,SAAS,CAAC,CAAC;YAC3B,CAAC,CAAC;QACJ,CAAC;KACF,CAAC,CAAC,CAAC;IAEJ,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B;QACzC,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAC,SAAS,GAAG;QACxD,6BAAK,SAAS,EAAC,oBAAoB;YACjC;gBAAO,MAAM;oBAAS;YACtB,kCAAO,MAAM,CAAQ,CACjB,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,15 +1,15 @@
1
1
  /* eslint-disable testing-library/await-async-query */
2
2
  /* eslint-disable testing-library/prefer-screen-queries */
3
3
  /* eslint-disable testing-library/render-result-naming-convention */
4
- import React from 'react';
5
- import { render } from '@core-utils';
6
- import { Timer as TimerComp } from './timer.component';
7
- it('render Timer correctly', () => {
8
- const time = render(React.createElement(TimerComp, { onClear: () => { } }));
9
- expect(time).toMatchSnapshot();
4
+ import React from "react";
5
+ import { render } from "@core-utils";
6
+ import { Timer as TimerComp } from "./timer.component";
7
+ it("render Timer correctly", () => {
8
+ const time = render(React.createElement(TimerComp, { onClear: () => {} }));
9
+ expect(time).toMatchSnapshot();
10
10
  });
11
- it('render Timer with minute correctly', () => {
12
- const time = render(React.createElement(TimerComp, { onClear: () => { } }));
13
- expect(time.findByText('minute')).toBeTruthy();
11
+ it("render Timer with minute correctly", () => {
12
+ const time = render(React.createElement(TimerComp, { onClear: () => {} }));
13
+ expect(time.findByText("minute")).toBeTruthy();
14
14
  });
15
- //# sourceMappingURL=timer.component.test.js.map
15
+ //# sourceMappingURL=timer.component.test.js.map
@@ -1,12 +1,12 @@
1
- export * from './atoms/buttons/buttons.component';
2
- export * from './atoms/check-box/checkBox.component';
3
- export * from './atoms/date-picker/date-picker.component';
4
- export * from './atoms/input/input-otp.component';
5
- export * from './atoms/input/input-pin.component';
6
- export * from './atoms/input/input.component';
7
- export * from './atoms/input-dropdown/input-dropdown.component';
8
- export * from './atoms/loader/loader.component';
9
- export * from './atoms/radio/radio.component';
10
- export * from './atoms/stepper/stepper.component';
11
- export * from './atoms/timer/timer.component';
12
- //# sourceMappingURL=index.js.map
1
+ export * from "./atoms/buttons/buttons.component";
2
+ export * from "./atoms/check-box/checkBox.component";
3
+ export * from "./atoms/date-picker/date-picker.component";
4
+ export * from "./atoms/input/input-otp.component";
5
+ export * from "./atoms/input/input-pin.component";
6
+ export * from "./atoms/input/input.component";
7
+ export * from "./atoms/input-dropdown/input-dropdown.component";
8
+ export * from "./atoms/loader/loader.component";
9
+ export * from "./atoms/radio/radio.component";
10
+ export * from "./atoms/stepper/stepper.component";
11
+ export * from "./atoms/timer/timer.component";
12
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export * from './unit-test.utils';
2
- //# sourceMappingURL=index.js.map
1
+ export * from "./unit-test.utils";
2
+ //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { render as renderComponent } from '@testing-library/react';
1
+ import React from "react";
2
+ import { render as renderComponent } from "@testing-library/react";
3
3
  const Providers = ({ children }) => {
4
- return React.createElement("div", null, children);
4
+ return React.createElement("div", null, children);
5
5
  };
6
6
  const render = (Component) => {
7
- return renderComponent(Component, { wrapper: Providers });
7
+ return renderComponent(Component, { wrapper: Providers });
8
8
  };
9
9
  export { render, Providers };
10
- //# sourceMappingURL=unit-test.utils.js.map
10
+ //# sourceMappingURL=unit-test.utils.js.map
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './core-components';
2
- //# sourceMappingURL=index.js.map
1
+ export * from "./core-components";
2
+ //# sourceMappingURL=index.js.map
@@ -1,13 +1,13 @@
1
1
  const reportWebVitals = (onPerfEntry) => {
2
- if (onPerfEntry && onPerfEntry instanceof Function) {
3
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4
- getCLS(onPerfEntry);
5
- getFID(onPerfEntry);
6
- getFCP(onPerfEntry);
7
- getLCP(onPerfEntry);
8
- getTTFB(onPerfEntry);
9
- });
10
- }
2
+ if (onPerfEntry && onPerfEntry instanceof Function) {
3
+ import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4
+ getCLS(onPerfEntry);
5
+ getFID(onPerfEntry);
6
+ getFCP(onPerfEntry);
7
+ getLCP(onPerfEntry);
8
+ getTTFB(onPerfEntry);
9
+ });
10
+ }
11
11
  };
12
12
  export default reportWebVitals;
13
- //# sourceMappingURL=reportWebVitals.js.map
13
+ //# sourceMappingURL=reportWebVitals.js.map
@@ -2,5 +2,5 @@
2
2
  // allows you to do things like:
3
3
  // expect(element).toHaveTextContent(/react/i)
4
4
  // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';
6
- //# sourceMappingURL=setupTests.js.map
5
+ import "@testing-library/jest-dom";
6
+ //# sourceMappingURL=setupTests.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.1.28",
3
+ "version": "0.1.31",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "main": "lib/cjs/index.js",
@@ -36,12 +36,20 @@
36
36
  "build": "tsc -p tsconfig.json & tsc -p tsconfig-cjs.json",
37
37
  "test": "react-scripts test",
38
38
  "eject": "react-scripts eject",
39
+ "precommit": "lint-staged --allow-empty",
39
40
  "storybook": "start-storybook -p 6006 -s public",
40
41
  "build-storybook": "build-storybook -o docs-build",
41
- "deploy-storybook": "gh-pages -d docs-build"
42
+ "deploy-storybook": "gh-pages -d docs-build",
43
+ "prettier": "prettier --write '**/*.{js,jsx}'",
44
+ "prepare": "husky install"
42
45
  },
43
46
  "files": [
44
- "lib/"
47
+ "*.md",
48
+ "dist",
49
+ "lib"
50
+ ],
51
+ "sideEffects": [
52
+ "**/*.css"
45
53
  ],
46
54
  "eslintConfig": {
47
55
  "extends": [
@@ -86,6 +94,8 @@
86
94
  "@storybook/testing-library": "^0.0.10",
87
95
  "craco-alias": "^3.0.1",
88
96
  "gh-pages": "^3.2.3",
97
+ "husky": "^7.0.4",
98
+ "lint-staged": "^12.4.0",
89
99
  "node": "^17.7.2",
90
100
  "webpack": "^5.72.0"
91
101
  },
@@ -102,5 +112,11 @@
102
112
  "bugs": {
103
113
  "url": "https://github.com/appasaheb4/react-restyle-components/issues"
104
114
  },
105
- "homepage": "https://github.com/appasaheb4/react-restyle-components#readme"
115
+ "homepage": "https://github.com/appasaheb4/react-restyle-components#readme",
116
+ "lint-staged": {
117
+ "*.{js,jsx,json,css,scss,md}": [
118
+ "prettier --write",
119
+ "git add"
120
+ ]
121
+ }
106
122
  }