react-restyle-components 0.1.27 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/App.js +36 -12
- package/lib/cjs/App.test.js +10 -8
- package/lib/cjs/core-components/atoms/buttons/button.stories.js +20 -8
- package/lib/cjs/core-components/atoms/buttons/buttons.component.js +17 -6
- package/lib/cjs/core-components/atoms/buttons/buttons.component.test.js +15 -7
- package/lib/cjs/core-components/atoms/check-box/checkBox.component.js +27 -11
- package/lib/cjs/core-components/atoms/check-box/checkBox.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/check-box/checkBox.component.test.js +14 -7
- package/lib/cjs/core-components/atoms/check-box/checkBox.stories.js +22 -9
- package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js +98 -38
- package/lib/cjs/core-components/atoms/date-picker/date-picker.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/date-picker/date-picker.component.test.js +15 -7
- package/lib/cjs/core-components/atoms/date-picker/date-picker.stories.js +18 -8
- package/lib/cjs/core-components/atoms/input/input-otp.component.js +119 -77
- package/lib/cjs/core-components/atoms/input/input-otp.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/input/input-otp.styles.css +35 -0
- package/lib/cjs/core-components/atoms/input/input-pin.component.js +174 -94
- package/lib/cjs/core-components/atoms/input/input-pin.component.test.js +28 -10
- package/lib/cjs/core-components/atoms/input/input-pin.stories.js +17 -9
- package/lib/cjs/core-components/atoms/input/input.component.js +65 -13
- package/lib/cjs/core-components/atoms/input/input.component.test.js +30 -10
- package/lib/cjs/core-components/atoms/input/input.stories.js +16 -7
- package/lib/cjs/core-components/atoms/input/input.styles.css +35 -0
- package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js +134 -58
- package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.component.test.js +16 -7
- package/lib/cjs/core-components/atoms/input-dropdown/input-dropdown.stories.js +14 -7
- package/lib/cjs/core-components/atoms/loader/loader.component.js +83 -21
- package/lib/cjs/core-components/atoms/loader/loader.component.test.js +11 -7
- package/lib/cjs/core-components/atoms/loader/loader.stories.js +14 -8
- package/lib/cjs/core-components/atoms/radio/radio.component.js +22 -8
- package/lib/cjs/core-components/atoms/radio/radio.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/radio/radio.component.test.js +14 -7
- package/lib/cjs/core-components/atoms/radio/radio.stories.js +22 -10
- package/lib/cjs/core-components/atoms/stepper/stepper.component.js +77 -34
- package/lib/cjs/core-components/atoms/stepper/stepper.component.test.js +16 -7
- package/lib/cjs/core-components/atoms/stepper/stepper.stories.js +15 -7
- package/lib/cjs/core-components/atoms/timer/timer.component.js +120 -93
- package/lib/cjs/core-components/atoms/timer/timer.component.js.map +1 -1
- package/lib/cjs/core-components/atoms/timer/timer.component.test.js +20 -10
- package/lib/cjs/core-components/index.js +44 -15
- package/lib/cjs/core-components/index.js.map +1 -1
- package/lib/cjs/core-utils/index.js +31 -15
- package/lib/cjs/core-utils/unit-test.utils.js +8 -6
- package/lib/cjs/index.js +31 -15
- package/lib/cjs/reportWebVitals.js +52 -29
- package/lib/cjs/setupTests.js +1 -1
- package/lib/esm/App.js +34 -12
- package/lib/esm/App.test.js +8 -8
- package/lib/esm/core-components/atoms/buttons/button.stories.js +17 -7
- package/lib/esm/core-components/atoms/buttons/buttons.component.js +13 -4
- package/lib/esm/core-components/atoms/buttons/buttons.component.test.js +13 -7
- package/lib/esm/core-components/atoms/check-box/checkBox.component.js +20 -9
- package/lib/esm/core-components/atoms/check-box/checkBox.component.js.map +1 -1
- package/lib/esm/core-components/atoms/check-box/checkBox.component.test.js +9 -7
- package/lib/esm/core-components/atoms/check-box/checkBox.stories.js +16 -8
- package/lib/esm/core-components/atoms/date-picker/date-picker.component.js +52 -20
- package/lib/esm/core-components/atoms/date-picker/date-picker.component.js.map +1 -1
- package/lib/esm/core-components/atoms/date-picker/date-picker.component.test.js +14 -8
- package/lib/esm/core-components/atoms/date-picker/date-picker.stories.js +16 -8
- package/lib/esm/core-components/atoms/input/input-otp.component.js +80 -59
- package/lib/esm/core-components/atoms/input/input-otp.component.js.map +1 -1
- package/lib/esm/core-components/atoms/input/input-pin.component.js +136 -77
- package/lib/esm/core-components/atoms/input/input-pin.component.test.js +26 -10
- package/lib/esm/core-components/atoms/input/input-pin.stories.js +14 -8
- package/lib/esm/core-components/atoms/input/input.component.js +62 -12
- package/lib/esm/core-components/atoms/input/input.component.test.js +28 -10
- package/lib/esm/core-components/atoms/input/input.stories.js +13 -6
- package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js +96 -37
- package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js.map +1 -1
- package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.test.js +14 -7
- package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.stories.js +11 -6
- package/lib/esm/core-components/atoms/loader/loader.component.js +80 -20
- package/lib/esm/core-components/atoms/loader/loader.component.test.js +7 -7
- package/lib/esm/core-components/atoms/loader/loader.stories.js +11 -7
- package/lib/esm/core-components/atoms/radio/radio.component.js +12 -6
- package/lib/esm/core-components/atoms/radio/radio.component.js.map +1 -1
- package/lib/esm/core-components/atoms/radio/radio.component.test.js +9 -7
- package/lib/esm/core-components/atoms/radio/radio.stories.js +16 -9
- package/lib/esm/core-components/atoms/stepper/stepper.component.js +74 -32
- package/lib/esm/core-components/atoms/stepper/stepper.component.test.js +14 -7
- package/lib/esm/core-components/atoms/stepper/stepper.stories.js +12 -6
- package/lib/esm/core-components/atoms/timer/timer.component.js +81 -75
- package/lib/esm/core-components/atoms/timer/timer.component.js.map +1 -1
- package/lib/esm/core-components/atoms/timer/timer.component.test.js +10 -10
- package/lib/esm/core-components/index.js +12 -2
- package/lib/esm/core-components/index.js.map +1 -1
- package/lib/esm/core-utils/index.js +2 -2
- package/lib/esm/core-utils/unit-test.utils.js +5 -5
- package/lib/esm/index.js +2 -2
- package/lib/esm/reportWebVitals.js +10 -10
- package/lib/esm/setupTests.js +2 -2
- package/package.json +20 -4
|
@@ -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
|
|
4
|
-
import { ReactComponent as TimerSVG } from
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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,
|
|
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,EA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AG,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
|
|
5
|
-
import { render } from
|
|
6
|
-
import { Timer as TimerComp } from
|
|
7
|
-
it(
|
|
8
|
-
|
|
9
|
-
|
|
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(
|
|
12
|
-
|
|
13
|
-
|
|
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,2 +1,12 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core-components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iDAAiD,CAAC;AAChE,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./unit-test.utils";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render as renderComponent } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render as renderComponent } from "@testing-library/react";
|
|
3
3
|
const Providers = ({ children }) => {
|
|
4
|
-
|
|
4
|
+
return React.createElement("div", null, children);
|
|
5
5
|
};
|
|
6
6
|
const render = (Component) => {
|
|
7
|
-
|
|
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
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
package/lib/esm/setupTests.js
CHANGED
|
@@ -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
|
|
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.
|
|
3
|
+
"version": "0.1.30",
|
|
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
|
-
"
|
|
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
|
}
|