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.
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 +44 -15
  42. package/lib/cjs/core-components/index.js.map +1 -1
  43. package/lib/cjs/core-utils/index.js +31 -15
  44. package/lib/cjs/core-utils/unit-test.utils.js +8 -6
  45. package/lib/cjs/index.js +31 -15
  46. package/lib/cjs/reportWebVitals.js +52 -29
  47. package/lib/cjs/setupTests.js +1 -1
  48. package/lib/esm/App.js +34 -12
  49. package/lib/esm/App.test.js +8 -8
  50. package/lib/esm/core-components/atoms/buttons/button.stories.js +17 -7
  51. package/lib/esm/core-components/atoms/buttons/buttons.component.js +13 -4
  52. package/lib/esm/core-components/atoms/buttons/buttons.component.test.js +13 -7
  53. package/lib/esm/core-components/atoms/check-box/checkBox.component.js +20 -9
  54. package/lib/esm/core-components/atoms/check-box/checkBox.component.js.map +1 -1
  55. package/lib/esm/core-components/atoms/check-box/checkBox.component.test.js +9 -7
  56. package/lib/esm/core-components/atoms/check-box/checkBox.stories.js +16 -8
  57. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js +52 -20
  58. package/lib/esm/core-components/atoms/date-picker/date-picker.component.js.map +1 -1
  59. package/lib/esm/core-components/atoms/date-picker/date-picker.component.test.js +14 -8
  60. package/lib/esm/core-components/atoms/date-picker/date-picker.stories.js +16 -8
  61. package/lib/esm/core-components/atoms/input/input-otp.component.js +80 -59
  62. package/lib/esm/core-components/atoms/input/input-otp.component.js.map +1 -1
  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-dropdown/input-dropdown.component.js +96 -37
  70. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.js.map +1 -1
  71. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.component.test.js +14 -7
  72. package/lib/esm/core-components/atoms/input-dropdown/input-dropdown.stories.js +11 -6
  73. package/lib/esm/core-components/atoms/loader/loader.component.js +80 -20
  74. package/lib/esm/core-components/atoms/loader/loader.component.test.js +7 -7
  75. package/lib/esm/core-components/atoms/loader/loader.stories.js +11 -7
  76. package/lib/esm/core-components/atoms/radio/radio.component.js +12 -6
  77. package/lib/esm/core-components/atoms/radio/radio.component.js.map +1 -1
  78. package/lib/esm/core-components/atoms/radio/radio.component.test.js +9 -7
  79. package/lib/esm/core-components/atoms/radio/radio.stories.js +16 -9
  80. package/lib/esm/core-components/atoms/stepper/stepper.component.js +74 -32
  81. package/lib/esm/core-components/atoms/stepper/stepper.component.test.js +14 -7
  82. package/lib/esm/core-components/atoms/stepper/stepper.stories.js +12 -6
  83. package/lib/esm/core-components/atoms/timer/timer.component.js +81 -75
  84. package/lib/esm/core-components/atoms/timer/timer.component.js.map +1 -1
  85. package/lib/esm/core-components/atoms/timer/timer.component.test.js +10 -10
  86. package/lib/esm/core-components/index.js +12 -2
  87. package/lib/esm/core-components/index.js.map +1 -1
  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,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,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG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AAM;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,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACvC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;oBAC5B,WAAW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,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,2 +1,12 @@
1
- export * from './atoms/stepper/stepper.component';
2
- //# 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 +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 './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.27",
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
- "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
  }