@kukkim/react-native-ui 0.1.5 → 0.1.7

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 (52) hide show
  1. package/lib/module/components/badge/index.js +2 -1
  2. package/lib/module/components/badge/index.js.map +1 -1
  3. package/lib/module/components/index.js +2 -1
  4. package/lib/module/components/index.js.map +1 -1
  5. package/lib/module/components/list/commonList.js +17 -0
  6. package/lib/module/components/list/commonList.js.map +1 -0
  7. package/lib/module/components/list/imageList.js +25 -0
  8. package/lib/module/components/list/imageList.js.map +1 -0
  9. package/lib/module/components/list/index.js +6 -0
  10. package/lib/module/components/list/index.js.map +1 -0
  11. package/lib/module/components/list/types.js +7 -0
  12. package/lib/module/components/list/types.js.map +1 -0
  13. package/lib/module/components/progressBar/circularProgressBar.js +16 -3
  14. package/lib/module/components/progressBar/circularProgressBar.js.map +1 -1
  15. package/lib/module/components/progressBar/index.js +0 -1
  16. package/lib/module/components/progressBar/index.js.map +1 -1
  17. package/lib/module/components/progressBar/linearProgressBar.js +15 -3
  18. package/lib/module/components/progressBar/linearProgressBar.js.map +1 -1
  19. package/lib/module/components/switch/commonSwitch.js +13 -17
  20. package/lib/module/components/switch/commonSwitch.js.map +1 -1
  21. package/lib/module/index.js +1 -1
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/typescript/src/components/badge/index.d.ts +2 -1
  24. package/lib/typescript/src/components/badge/index.d.ts.map +1 -1
  25. package/lib/typescript/src/components/index.d.ts +2 -1
  26. package/lib/typescript/src/components/index.d.ts.map +1 -1
  27. package/lib/typescript/src/components/list/commonList.d.ts +4 -0
  28. package/lib/typescript/src/components/list/commonList.d.ts.map +1 -0
  29. package/lib/typescript/src/components/list/imageList.d.ts +4 -0
  30. package/lib/typescript/src/components/list/imageList.d.ts.map +1 -0
  31. package/lib/typescript/src/components/list/index.d.ts +4 -0
  32. package/lib/typescript/src/components/list/index.d.ts.map +1 -0
  33. package/lib/typescript/src/components/list/types.d.ts +10 -0
  34. package/lib/typescript/src/components/list/types.d.ts.map +1 -0
  35. package/lib/typescript/src/components/progressBar/circularProgressBar.d.ts.map +1 -1
  36. package/lib/typescript/src/components/progressBar/index.d.ts.map +1 -1
  37. package/lib/typescript/src/components/progressBar/linearProgressBar.d.ts.map +1 -1
  38. package/lib/typescript/src/components/switch/commonSwitch.d.ts.map +1 -1
  39. package/lib/typescript/src/index.d.ts +1 -1
  40. package/lib/typescript/src/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/components/badge/index.ts +2 -1
  43. package/src/components/index.ts +2 -1
  44. package/src/components/list/commonList.tsx +14 -0
  45. package/src/components/list/imageList.tsx +25 -0
  46. package/src/components/list/index.ts +4 -0
  47. package/src/components/list/types.ts +14 -0
  48. package/src/components/progressBar/circularProgressBar.tsx +23 -3
  49. package/src/components/progressBar/index.ts +0 -1
  50. package/src/components/progressBar/linearProgressBar.tsx +31 -10
  51. package/src/components/switch/commonSwitch.tsx +17 -13
  52. package/src/index.tsx +3 -0
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  import CommonBadge from "./commonBadge.js";
4
- export { CommonBadge };
4
+ import NumberBadge from "./numberBadge.js";
5
+ export { CommonBadge, NumberBadge };
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CommonBadge"],"sourceRoot":"../../../../src","sources":["components/badge/index.ts"],"mappings":";;AAAA,OAAOA,WAAW,MAAM,kBAAe;AAEvC,SAASA,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["CommonBadge","NumberBadge"],"sourceRoot":"../../../../src","sources":["components/badge/index.ts"],"mappings":";;AAAA,OAAOA,WAAW,MAAM,kBAAe;AACvC,OAAOC,WAAW,MAAM,kBAAe;AAEvC,SAASD,WAAW,EAAEC,WAAW","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
  export { CommonText } from "./text/index.js";
4
4
  export { CommonButton, SocialLoginButton } from "./button/index.js";
5
- export { CommonBadge } from "./badge/index.js";
5
+ export { CommonBadge, NumberBadge } from "./badge/index.js";
6
6
  export { SafeAreaContainer, ScrollViewContainer } from "./screenContainer/index.js";
7
7
  export { CommonIcon } from "./icon/index.js";
8
8
  export { CommonRating } from "./rating/index.js";
@@ -18,4 +18,5 @@ export { CommonSwitch } from "./switch/index.js";
18
18
  export { CommonSpinner } from "./spinner/index.js";
19
19
  export { CommonSlider } from "./slider/index.js";
20
20
  export { CommonSelect, SelectItem } from "./select/index.js";
21
+ export { CommonList, ImageList } from "./list/index.js";
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CommonText","CommonButton","SocialLoginButton","CommonBadge","SafeAreaContainer","ScrollViewContainer","CommonIcon","CommonRating","CommonAvatar","CommonImage","CheckBox","CommonHeader","CommonCard","FoldableCard","LinearProgressBar","CircularProgressBar","CommonInput","CommonPopOver","CommonSwitch","CommonSpinner","CommonSlider","CommonSelect","SelectItem"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAQ;AACnC,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,mBAAU;AAC1D,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,4BAAmB;AAC1E,SAASC,UAAU,QAAQ,iBAAQ;AACnC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,QAAQ,QAAQ,qBAAY;AACrC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAQ;AACjD,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,wBAAe;AACtE,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,YAAY,EAAEC,UAAU,QAAQ,mBAAU","ignoreList":[]}
1
+ {"version":3,"names":["CommonText","CommonButton","SocialLoginButton","CommonBadge","NumberBadge","SafeAreaContainer","ScrollViewContainer","CommonIcon","CommonRating","CommonAvatar","CommonImage","CheckBox","CommonHeader","CommonCard","FoldableCard","LinearProgressBar","CircularProgressBar","CommonInput","CommonPopOver","CommonSwitch","CommonSpinner","CommonSlider","CommonSelect","SelectItem","CommonList","ImageList"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAQ;AACnC,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,mBAAU;AAC1D,SAASC,WAAW,EAAEC,WAAW,QAAQ,kBAAS;AAClD,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,4BAAmB;AAC1E,SAASC,UAAU,QAAQ,iBAAQ;AACnC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,QAAQ,QAAQ,qBAAY;AACrC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAQ;AACjD,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,wBAAe;AACtE,SAASC,WAAW,QAAQ,kBAAS;AACrC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,aAAa,QAAQ,oBAAW;AACzC,SAASC,YAAY,QAAQ,mBAAU;AACvC,SAASC,YAAY,EAAEC,UAAU,QAAQ,mBAAU;AACnD,SAASC,UAAU,EAAEC,SAAS,QAAQ,iBAAQ","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ import { FlatList, StyleSheet } from 'react-native';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const CommonList = props => {
6
+ return /*#__PURE__*/_jsx(FlatList, {
7
+ style: styles.container,
8
+ ...props
9
+ });
10
+ };
11
+ const styles = StyleSheet.create({
12
+ container: {
13
+ flex: 1
14
+ }
15
+ });
16
+ export default CommonList;
17
+ //# sourceMappingURL=commonList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FlatList","StyleSheet","jsx","_jsx","CommonList","props","style","styles","container","create","flex"],"sourceRoot":"../../../../src","sources":["components/list/commonList.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGpD,MAAMC,UAAU,GAAYC,KAA6B,IAAK;EAC5D,oBAAOF,IAAA,CAACH,QAAQ;IAACM,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAA,GAAKH;EAAK,CAAG,CAAC;AACzD,CAAC;AAED,MAAME,MAAM,GAAGN,UAAU,CAACQ,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,eAAeN,UAAU","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ import { FlatList, StyleSheet } from 'react-native';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ // import { CommonImage } from "../image";
6
+
7
+ const ImgList = props => {
8
+ return /*#__PURE__*/_jsx(FlatList, {
9
+ style: styles.container
10
+ // renderItem={({ item }) => <CommonImage title={item.title} />}
11
+ ,
12
+ ...props
13
+ });
14
+ };
15
+ const styles = StyleSheet.create({
16
+ container: {
17
+ width: 'auto',
18
+ margin: 5,
19
+ padding: 5,
20
+ borderWidth: 1,
21
+ borderRadius: 3
22
+ }
23
+ });
24
+ export default ImgList;
25
+ //# sourceMappingURL=imageList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FlatList","StyleSheet","jsx","_jsx","ImgList","props","style","styles","container","create","width","margin","padding","borderWidth","borderRadius"],"sourceRoot":"../../../../src","sources":["components/list/imageList.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD;;AAEA,MAAMC,OAAO,GAAYC,KAA6B,IAAK;EACzD,oBACEF,IAAA,CAACH,QAAQ;IACPM,KAAK,EAAEC,MAAM,CAACC;IACd;IAAA;IAAA,GACIH;EAAK,CACV,CAAC;AAEN,CAAC;AAED,MAAME,MAAM,GAAGN,UAAU,CAACQ,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC;IACVC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAeV,OAAO","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ import CommonList from "./commonList.js";
4
+ import ImageList from "./imageList.js";
5
+ export { CommonList, ImageList };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CommonList","ImageList"],"sourceRoot":"../../../../src","sources":["components/list/index.ts"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,iBAAc;AACrC,OAAOC,SAAS,MAAM,gBAAa;AAEnC,SAASD,UAAU,EAAEC,SAAS","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ export const containerType = {
4
+ primary: {},
5
+ secondary: {}
6
+ };
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["containerType","primary","secondary"],"sourceRoot":"../../../../src","sources":["components/list/types.ts"],"mappings":";;AAKA,OAAO,MAAMA,aAAyC,GAAG;EACvDC,OAAO,EAAE,CAAC,CAAC;EACXC,SAAS,EAAE,CAAC;AACd,CAAC","ignoreList":[]}
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ import { useEffect } from 'react';
3
4
  import { StyleSheet, View } from 'react-native';
4
5
  import Svg, { Circle } from 'react-native-svg';
6
+ import Animated, { useAnimatedProps, useSharedValue, withTiming } from 'react-native-reanimated';
5
7
  import { sizeType, strokeWidthType } from "./types.js";
6
8
  import { useTheme } from "../../hooks/useTheme.js";
7
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const AnimatedCircle = Animated.createAnimatedComponent(Circle);
8
11
  const CircularProgressBar = ({
9
12
  type = 'primary',
10
13
  size = 'm',
@@ -20,7 +23,17 @@ const CircularProgressBar = ({
20
23
  const strokeWidth = strokeWidthType[size];
21
24
  const radius = (svgSize - strokeWidth) / 2;
22
25
  const circumference = 2 * Math.PI * radius;
23
- const strokeDashoffset = circumference * (1 - progress);
26
+ const animatedProgress = useSharedValue(0);
27
+ useEffect(() => {
28
+ animatedProgress.value = withTiming(progress, {
29
+ duration: 500
30
+ });
31
+ }, [progress, animatedProgress]);
32
+ const animatedProps = useAnimatedProps(() => {
33
+ return {
34
+ strokeDashoffset: circumference * (1 - animatedProgress.value)
35
+ };
36
+ });
24
37
  return /*#__PURE__*/_jsx(View, {
25
38
  style: [styles.container, style],
26
39
  ...props,
@@ -35,7 +48,7 @@ const CircularProgressBar = ({
35
48
  stroke: theme.colors.disabled,
36
49
  strokeWidth: strokeWidth,
37
50
  fill: "none"
38
- }), /*#__PURE__*/_jsx(Circle, {
51
+ }), /*#__PURE__*/_jsx(AnimatedCircle, {
39
52
  cx: svgSize / 2,
40
53
  cy: svgSize / 2,
41
54
  r: radius,
@@ -44,7 +57,7 @@ const CircularProgressBar = ({
44
57
  fill: "none",
45
58
  strokeLinecap: "round",
46
59
  strokeDasharray: circumference,
47
- strokeDashoffset: strokeDashoffset,
60
+ animatedProps: animatedProps,
48
61
  rotation: "-90",
49
62
  originX: svgSize / 2,
50
63
  originY: svgSize / 2
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","View","Svg","Circle","sizeType","strokeWidthType","useTheme","jsx","_jsx","jsxs","_jsxs","CircularProgressBar","type","size","value","style","props","theme","progress","Math","min","max","svgSize","strokeWidth","radius","circumference","PI","strokeDashoffset","styles","container","children","width","height","viewBox","cx","cy","r","stroke","colors","disabled","fill","strokeLinecap","strokeDasharray","rotation","originX","originY","create"],"sourceRoot":"../../../../src","sources":["components/progressBar/circularProgressBar.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,GAAG,IAAIC,MAAM,QAAQ,kBAAkB;AAC9C,SAAgCC,QAAQ,EAAEC,eAAe,QAAQ,YAAS;AAC1E,SAASC,QAAQ,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhD,MAAMC,mBAAmB,GAAGA,CAAC;EAC3BC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,GAAG;EACVC,KAAK;EACLC,KAAK;EACL,GAAGC;AACa,CAAC,KAAK;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGX,QAAQ,CAAC,CAAC;EAE5B,MAAMY,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACP,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAEhD,MAAMQ,OAAO,GAAGlB,QAAQ,CAACS,IAAI,CAAC;EAC9B,MAAMU,WAAW,GAAGlB,eAAe,CAACQ,IAAI,CAAC;EAEzC,MAAMW,MAAM,GAAG,CAACF,OAAO,GAAGC,WAAW,IAAI,CAAC;EAC1C,MAAME,aAAa,GAAG,CAAC,GAAGN,IAAI,CAACO,EAAE,GAAGF,MAAM;EAE1C,MAAMG,gBAAgB,GAAGF,aAAa,IAAI,CAAC,GAAGP,QAAQ,CAAC;EAEvD,oBACEV,IAAA,CAACP,IAAI;IAACc,KAAK,EAAE,CAACa,MAAM,CAACC,SAAS,EAAEd,KAAK,CAAE;IAAA,GAAKC,KAAK;IAAAc,QAAA,eAC/CpB,KAAA,CAACR,GAAG;MACF6B,KAAK,EAAET,OAAQ;MACfU,MAAM,EAAEV,OAAQ;MAChBW,OAAO,EAAE,OAAOX,OAAO,IAAIA,OAAO,EAAG;MAAAQ,QAAA,gBAErCtB,IAAA,CAACL,MAAM;QACL+B,EAAE,EAAEZ,OAAO,GAAG,CAAE;QAChBa,EAAE,EAAEb,OAAO,GAAG,CAAE;QAChBc,CAAC,EAAEZ,MAAO;QACVa,MAAM,EAAEpB,KAAK,CAACqB,MAAM,CAACC,QAAS;QAC9BhB,WAAW,EAAEA,WAAY;QACzBiB,IAAI,EAAC;MAAM,CACZ,CAAC,eAEFhC,IAAA,CAACL,MAAM;QACL+B,EAAE,EAAEZ,OAAO,GAAG,CAAE;QAChBa,EAAE,EAAEb,OAAO,GAAG,CAAE;QAChBc,CAAC,EAAEZ,MAAO;QACVa,MAAM,EAAEpB,KAAK,CAACqB,MAAM,CAAC1B,IAAI,CAAE;QAC3BW,WAAW,EAAEA,WAAY;QACzBiB,IAAI,EAAC,MAAM;QACXC,aAAa,EAAC,OAAO;QACrBC,eAAe,EAAEjB,aAAc;QAC/BE,gBAAgB,EAAEA,gBAAiB;QACnCgB,QAAQ,EAAC,KAAK;QACdC,OAAO,EAAEtB,OAAO,GAAG,CAAE;QACrBuB,OAAO,EAAEvB,OAAO,GAAG;MAAE,CACtB,CAAC;IAAA,CACC;EAAC,CACF,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAG5B,UAAU,CAAC8C,MAAM,CAAC;EAC/BjB,SAAS,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,eAAelB,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","StyleSheet","View","Svg","Circle","Animated","useAnimatedProps","useSharedValue","withTiming","sizeType","strokeWidthType","useTheme","jsx","_jsx","jsxs","_jsxs","AnimatedCircle","createAnimatedComponent","CircularProgressBar","type","size","value","style","props","theme","progress","Math","min","max","svgSize","strokeWidth","radius","circumference","PI","animatedProgress","duration","animatedProps","strokeDashoffset","styles","container","children","width","height","viewBox","cx","cy","r","stroke","colors","disabled","fill","strokeLinecap","strokeDasharray","rotation","originX","originY","create"],"sourceRoot":"../../../../src","sources":["components/progressBar/circularProgressBar.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,GAAG,IAAIC,MAAM,QAAQ,kBAAkB;AAC9C,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAAgCC,QAAQ,EAAEC,eAAe,QAAQ,YAAS;AAC1E,SAASC,QAAQ,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhD,MAAMC,cAAc,GAAGX,QAAQ,CAACY,uBAAuB,CAACb,MAAM,CAAC;AAE/D,MAAMc,mBAAmB,GAAGA,CAAC;EAC3BC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,GAAG;EACVC,KAAK;EACLC,KAAK;EACL,GAAGC;AACa,CAAC,KAAK;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGb,QAAQ,CAAC,CAAC;EAE5B,MAAMc,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACP,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAEhD,MAAMQ,OAAO,GAAGpB,QAAQ,CAACW,IAAI,CAAC;EAC9B,MAAMU,WAAW,GAAGpB,eAAe,CAACU,IAAI,CAAC;EAEzC,MAAMW,MAAM,GAAG,CAACF,OAAO,GAAGC,WAAW,IAAI,CAAC;EAC1C,MAAME,aAAa,GAAG,CAAC,GAAGN,IAAI,CAACO,EAAE,GAAGF,MAAM;EAE1C,MAAMG,gBAAgB,GAAG3B,cAAc,CAAC,CAAC,CAAC;EAE1CP,SAAS,CAAC,MAAM;IACdkC,gBAAgB,CAACb,KAAK,GAAGb,UAAU,CAACiB,QAAQ,EAAE;MAC5CU,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,EAAE,CAACV,QAAQ,EAAES,gBAAgB,CAAC,CAAC;EAEhC,MAAME,aAAa,GAAG9B,gBAAgB,CAAC,MAAM;IAC3C,OAAO;MACL+B,gBAAgB,EAAEL,aAAa,IAAI,CAAC,GAAGE,gBAAgB,CAACb,KAAK;IAC/D,CAAC;EACH,CAAC,CAAC;EAEF,oBACER,IAAA,CAACX,IAAI;IAACoB,KAAK,EAAE,CAACgB,MAAM,CAACC,SAAS,EAAEjB,KAAK,CAAE;IAAA,GAAKC,KAAK;IAAAiB,QAAA,eAC/CzB,KAAA,CAACZ,GAAG;MACFsC,KAAK,EAAEZ,OAAQ;MACfa,MAAM,EAAEb,OAAQ;MAChBc,OAAO,EAAE,OAAOd,OAAO,IAAIA,OAAO,EAAG;MAAAW,QAAA,gBAErC3B,IAAA,CAACT,MAAM;QACLwC,EAAE,EAAEf,OAAO,GAAG,CAAE;QAChBgB,EAAE,EAAEhB,OAAO,GAAG,CAAE;QAChBiB,CAAC,EAAEf,MAAO;QACVgB,MAAM,EAAEvB,KAAK,CAACwB,MAAM,CAACC,QAAS;QAC9BnB,WAAW,EAAEA,WAAY;QACzBoB,IAAI,EAAC;MAAM,CACZ,CAAC,eAEFrC,IAAA,CAACG,cAAc;QACb4B,EAAE,EAAEf,OAAO,GAAG,CAAE;QAChBgB,EAAE,EAAEhB,OAAO,GAAG,CAAE;QAChBiB,CAAC,EAAEf,MAAO;QACVgB,MAAM,EAAEvB,KAAK,CAACwB,MAAM,CAAC7B,IAAI,CAAE;QAC3BW,WAAW,EAAEA,WAAY;QACzBoB,IAAI,EAAC,MAAM;QACXC,aAAa,EAAC,OAAO;QACrBC,eAAe,EAAEpB,aAAc;QAC/BI,aAAa,EAAEA,aAAc;QAC7BiB,QAAQ,EAAC,KAAK;QACdC,OAAO,EAAEzB,OAAO,GAAG,CAAE;QACrB0B,OAAO,EAAE1B,OAAO,GAAG;MAAE,CACtB,CAAC;IAAA,CACC;EAAC,CACF,CAAC;AAEX,CAAC;AAED,MAAMS,MAAM,GAAGrC,UAAU,CAACuD,MAAM,CAAC;EAC/BjB,SAAS,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,eAAerB,mBAAmB","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- // TODO: progressbar에 react-native-reanimated를 이용한 animation적용 필요.
4
3
  import LinearProgressBar from "./linearProgressBar.js";
5
4
  import CircularProgressBar from "./circularProgressBar.js";
6
5
  export { LinearProgressBar, CircularProgressBar };
@@ -1 +1 @@
1
- {"version":3,"names":["LinearProgressBar","CircularProgressBar"],"sourceRoot":"../../../../src","sources":["components/progressBar/index.ts"],"mappings":";;AAAA;AACA,OAAOA,iBAAiB,MAAM,wBAAqB;AACnD,OAAOC,mBAAmB,MAAM,0BAAuB;AAEvD,SAASD,iBAAiB,EAAEC,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["LinearProgressBar","CircularProgressBar"],"sourceRoot":"../../../../src","sources":["components/progressBar/index.ts"],"mappings":";;AAAA,OAAOA,iBAAiB,MAAM,wBAAqB;AACnD,OAAOC,mBAAmB,MAAM,0BAAuB;AAEvD,SAASD,iBAAiB,EAAEC,mBAAmB","ignoreList":[]}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
+ import { useState } from 'react';
3
4
  import { StyleSheet, View } from 'react-native';
5
+ import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';
4
6
  import { useTheme } from "../../hooks/useTheme.js";
5
7
  import { jsx as _jsx } from "react/jsx-runtime";
6
8
  const LinearProgressBar = ({
@@ -13,16 +15,26 @@ const LinearProgressBar = ({
13
15
  theme
14
16
  } = useTheme();
15
17
  const progress = Math.min(Math.max(value, 0), 1);
18
+ const [containerWidth, setContainerWidth] = useState(0);
19
+ const animatedStyle = useAnimatedStyle(() => ({
20
+ width: withTiming(containerWidth * progress, {
21
+ duration: 1000
22
+ })
23
+ }));
24
+ const onLayout = e => {
25
+ setContainerWidth(e.nativeEvent.layout.width);
26
+ };
16
27
  return /*#__PURE__*/_jsx(View, {
17
28
  style: [styles.container, {
18
29
  backgroundColor: theme.colors.disabled
19
30
  }, style],
31
+ onLayout: onLayout,
20
32
  ...props,
21
- children: /*#__PURE__*/_jsx(View, {
33
+ children: containerWidth > 0 && /*#__PURE__*/_jsx(Animated.View, {
22
34
  style: [styles.progress, {
23
- width: `${progress * 100}%`,
35
+ width: containerWidth,
24
36
  backgroundColor: theme.colors[type]
25
- }]
37
+ }, animatedStyle]
26
38
  })
27
39
  });
28
40
  };
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","View","useTheme","jsx","_jsx","LinearProgressBar","type","value","style","props","theme","progress","Math","min","max","styles","container","backgroundColor","colors","disabled","children","width","create","height","borderRadius","overflow"],"sourceRoot":"../../../../src","sources":["components/progressBar/linearProgressBar.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,QAAQ,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,IAAI,GAAG,SAAS;EAChBC,KAAK;EACLC,KAAK;EACL,GAAGC;AACa,CAAC,KAAK;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAC5B,MAAMS,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACP,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAEhD,oBACEH,IAAA,CAACH,IAAI;IACHO,KAAK,EAAE,CACLO,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEP,KAAK,CAACQ,MAAM,CAACC;IAChC,CAAC,EACDX,KAAK,CACL;IAAA,GACEC,KAAK;IAAAW,QAAA,eAEThB,IAAA,CAACH,IAAI;MACHO,KAAK,EAAE,CACLO,MAAM,CAACJ,QAAQ,EACf;QACEU,KAAK,EAAE,GAAGV,QAAQ,GAAG,GAAG,GAAG;QAC3BM,eAAe,EAAEP,KAAK,CAACQ,MAAM,CAACZ,IAAI;MACpC,CAAC;IACD,CACH;EAAC,CACE,CAAC;AAEX,CAAC;AAED,MAAMS,MAAM,GAAGf,UAAU,CAACsB,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTK,KAAK,EAAE,MAAM;IACbE,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,GAAG;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDd,QAAQ,EAAE;IACRY,MAAM,EAAE,MAAM;IACdC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAenB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useState","StyleSheet","View","Animated","useAnimatedStyle","withTiming","useTheme","jsx","_jsx","LinearProgressBar","type","value","style","props","theme","progress","Math","min","max","containerWidth","setContainerWidth","animatedStyle","width","duration","onLayout","e","nativeEvent","layout","styles","container","backgroundColor","colors","disabled","children","create","height","borderRadius","overflow"],"sourceRoot":"../../../../src","sources":["components/progressBar/linearProgressBar.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,UAAU,EAAEC,IAAI,QAAgC,cAAc;AACvE,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,UAAU,QACL,yBAAyB;AAEhC,SAASC,QAAQ,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,IAAI,GAAG,SAAS;EAChBC,KAAK;EACLC,KAAK;EACL,GAAGC;AACa,CAAC,KAAK;EACtB,MAAM;IAAEC;EAAM,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAC5B,MAAMS,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACP,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAEhD,MAAM,CAACQ,cAAc,EAAEC,iBAAiB,CAAC,GAAGpB,QAAQ,CAAC,CAAC,CAAC;EAEvD,MAAMqB,aAAa,GAAGjB,gBAAgB,CAAC,OAAO;IAC5CkB,KAAK,EAAEjB,UAAU,CAACc,cAAc,GAAGJ,QAAQ,EAAE;MAC3CQ,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,CAAC,CAAC;EAEH,MAAMC,QAAQ,GAAIC,CAAoB,IAAK;IACzCL,iBAAiB,CAACK,CAAC,CAACC,WAAW,CAACC,MAAM,CAACL,KAAK,CAAC;EAC/C,CAAC;EAED,oBACEd,IAAA,CAACN,IAAI;IACHU,KAAK,EAAE,CACLgB,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEhB,KAAK,CAACiB,MAAM,CAACC;IAChC,CAAC,EACDpB,KAAK,CACL;IACFY,QAAQ,EAAEA,QAAS;IAAA,GACfX,KAAK;IAAAoB,QAAA,EAERd,cAAc,GAAG,CAAC,iBACjBX,IAAA,CAACL,QAAQ,CAACD,IAAI;MACZU,KAAK,EAAE,CACLgB,MAAM,CAACb,QAAQ,EACf;QACEO,KAAK,EAAEH,cAAc;QACrBW,eAAe,EAAEhB,KAAK,CAACiB,MAAM,CAACrB,IAAI;MACpC,CAAC,EACDW,aAAa;IACb,CACH;EACF,CACG,CAAC;AAEX,CAAC;AAED,MAAMO,MAAM,GAAG3B,UAAU,CAACiC,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACTP,KAAK,EAAE,MAAM;IACba,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,GAAG;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDtB,QAAQ,EAAE;IACRoB,MAAM,EAAE,MAAM;IACdC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAe3B,iBAAiB","ignoreList":[]}
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import { useEffect, useRef } from 'react';
4
- import { Animated, Pressable, StyleSheet } from 'react-native';
3
+ import { Pressable, StyleSheet } from 'react-native';
5
4
  import { sizeType } from "./types.js";
6
5
  import { useTheme } from "../../hooks/useTheme.js";
7
-
8
- //TODO: react-native-reanimated로 수정필요
6
+ import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';
9
7
  import { jsx as _jsx } from "react/jsx-runtime";
10
8
  export default function CommonSwitch({
11
9
  type = 'primary',
@@ -18,18 +16,19 @@ export default function CommonSwitch({
18
16
  const {
19
17
  theme
20
18
  } = useTheme();
21
- const animValue = useRef(new Animated.Value(value ? 1 : 0)).current;
22
19
  const sizeValue = sizeType[size];
23
20
  const containerWidth = (sizeValue + 2) * 2;
24
21
  const thumbSize = sizeValue;
25
22
  const translateX = containerWidth - thumbSize - 2;
26
- useEffect(() => {
27
- Animated.timing(animValue, {
28
- toValue: value ? translateX : 0,
29
- duration: 200,
30
- useNativeDriver: true
31
- }).start();
32
- }, [value, translateX, animValue]);
23
+ const thumbAnimatedStyle = useAnimatedStyle(() => {
24
+ return {
25
+ transform: [{
26
+ translateX: withTiming(value ? translateX : 0, {
27
+ duration: 200
28
+ })
29
+ }]
30
+ };
31
+ }, [value, translateX]);
33
32
  const toggleValue = () => {
34
33
  if (disabled) return;
35
34
  onChange?.(!value);
@@ -49,11 +48,8 @@ export default function CommonSwitch({
49
48
  width: thumbSize,
50
49
  height: thumbSize,
51
50
  borderRadius: thumbSize / 2,
52
- backgroundColor: value ? theme.colors[type] : theme.colors.disabled,
53
- transform: [{
54
- translateX: animValue
55
- }]
56
- }]
51
+ backgroundColor: value ? theme.colors[type] : theme.colors.disabled
52
+ }, thumbAnimatedStyle]
57
53
  })
58
54
  });
59
55
  }
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","Animated","Pressable","StyleSheet","sizeType","useTheme","jsx","_jsx","CommonSwitch","type","size","value","onChange","disabled","props","theme","animValue","Value","current","sizeValue","containerWidth","thumbSize","translateX","timing","toValue","duration","useNativeDriver","start","toggleValue","style","styles","container","width","height","borderRadius","borderColor","colors","border","onPress","children","View","backgroundColor","transform","create","padding","justifyContent","borderWidth","opacity"],"sourceRoot":"../../../../src","sources":["components/switch/commonSwitch.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAC9D,SAA2BC,QAAQ,QAAQ,YAAS;AACpD,SAASC,QAAQ,QAAQ,yBAAsB;;AAE/C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,eAAe,SAASC,YAAYA,CAAC;EACnCC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,GAAG;EACVC,KAAK;EACLC,QAAQ;EACRC,QAAQ,GAAG,KAAK;EAChB,GAAGC;AACQ,CAAC,EAAE;EACd,MAAM;IAAEC;EAAM,CAAC,GAAGV,QAAQ,CAAC,CAAC;EAE5B,MAAMW,SAAS,GAAGhB,MAAM,CAAC,IAAIC,QAAQ,CAACgB,KAAK,CAACN,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAACO,OAAO;EAEnE,MAAMC,SAAS,GAAGf,QAAQ,CAACM,IAAI,CAAC;EAChC,MAAMU,cAAc,GAAG,CAACD,SAAS,GAAG,CAAC,IAAI,CAAC;EAC1C,MAAME,SAAS,GAAGF,SAAS;EAC3B,MAAMG,UAAU,GAAGF,cAAc,GAAGC,SAAS,GAAG,CAAC;EAEjDtB,SAAS,CAAC,MAAM;IACdE,QAAQ,CAACsB,MAAM,CAACP,SAAS,EAAE;MACzBQ,OAAO,EAAEb,KAAK,GAAGW,UAAU,GAAG,CAAC;MAC/BG,QAAQ,EAAE,GAAG;MACbC,eAAe,EAAE;IACnB,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC;EACZ,CAAC,EAAE,CAAChB,KAAK,EAAEW,UAAU,EAAEN,SAAS,CAAC,CAAC;EAElC,MAAMY,WAAW,GAAGA,CAAA,KAAM;IACxB,IAAIf,QAAQ,EAAE;IACdD,QAAQ,GAAG,CAACD,KAAK,CAAC;EACpB,CAAC;EAED,oBACEJ,IAAA,CAACL,SAAS;IACR2B,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,KAAK,EAAEZ,cAAc;MACrBa,MAAM,EAAEd,SAAS,GAAG,CAAC;MACrBe,YAAY,EAAEf,SAAS,GAAG,CAAC,GAAG,CAAC;MAC/BgB,WAAW,EAAEtB,QAAQ,GAAGE,KAAK,CAACqB,MAAM,CAACvB,QAAQ,GAAGE,KAAK,CAACqB,MAAM,CAACC;IAC/D,CAAC,EACDxB,QAAQ,IAAIiB,MAAM,CAACjB,QAAQ,CAC3B;IACFyB,OAAO,EAAEV,WAAY;IACrBf,QAAQ,EAAEA,QAAS;IAAA,GACfC,KAAK;IAAAyB,QAAA,eAEThC,IAAA,CAACN,QAAQ,CAACuC,IAAI;MACZX,KAAK,EAAE,CACL;QACEG,KAAK,EAAEX,SAAS;QAChBY,MAAM,EAAEZ,SAAS;QACjBa,YAAY,EAAEb,SAAS,GAAG,CAAC;QAC3BoB,eAAe,EAAE9B,KAAK,GAAGI,KAAK,CAACqB,MAAM,CAAC3B,IAAI,CAAC,GAAGM,KAAK,CAACqB,MAAM,CAACvB,QAAQ;QACnE6B,SAAS,EAAE,CAAC;UAAEpB,UAAU,EAAEN;QAAU,CAAC;MACvC,CAAC;IACD,CACH;EAAC,CACO,CAAC;AAEhB;AAEA,MAAMc,MAAM,GAAG3B,UAAU,CAACwC,MAAM,CAAC;EAC/BZ,SAAS,EAAE;IACTa,OAAO,EAAE,CAAC;IACVC,cAAc,EAAE,QAAQ;IACxBC,WAAW,EAAE;EACf,CAAC;EACDjC,QAAQ,EAAE;IACRkC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Pressable","StyleSheet","sizeType","useTheme","Animated","useAnimatedStyle","withTiming","jsx","_jsx","CommonSwitch","type","size","value","onChange","disabled","props","theme","sizeValue","containerWidth","thumbSize","translateX","thumbAnimatedStyle","transform","duration","toggleValue","style","styles","container","width","height","borderRadius","borderColor","colors","border","onPress","children","View","backgroundColor","create","padding","justifyContent","borderWidth","opacity"],"sourceRoot":"../../../../src","sources":["components/switch/commonSwitch.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,QAAQ,cAAc;AACpD,SAA2BC,QAAQ,QAAQ,YAAS;AACpD,SAASC,QAAQ,QAAQ,yBAAsB;AAC/C,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,UAAU,QACL,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjC,eAAe,SAASC,YAAYA,CAAC;EACnCC,IAAI,GAAG,SAAS;EAChBC,IAAI,GAAG,GAAG;EACVC,KAAK;EACLC,QAAQ;EACRC,QAAQ,GAAG,KAAK;EAChB,GAAGC;AACQ,CAAC,EAAE;EACd,MAAM;IAAEC;EAAM,CAAC,GAAGb,QAAQ,CAAC,CAAC;EAE5B,MAAMc,SAAS,GAAGf,QAAQ,CAACS,IAAI,CAAC;EAChC,MAAMO,cAAc,GAAG,CAACD,SAAS,GAAG,CAAC,IAAI,CAAC;EAC1C,MAAME,SAAS,GAAGF,SAAS;EAC3B,MAAMG,UAAU,GAAGF,cAAc,GAAGC,SAAS,GAAG,CAAC;EAEjD,MAAME,kBAAkB,GAAGhB,gBAAgB,CAAC,MAAM;IAChD,OAAO;MACLiB,SAAS,EAAE,CACT;QACEF,UAAU,EAAEd,UAAU,CAACM,KAAK,GAAGQ,UAAU,GAAG,CAAC,EAAE;UAC7CG,QAAQ,EAAE;QACZ,CAAC;MACH,CAAC;IAEL,CAAC;EACH,CAAC,EAAE,CAACX,KAAK,EAAEQ,UAAU,CAAC,CAAC;EAEvB,MAAMI,WAAW,GAAGA,CAAA,KAAM;IACxB,IAAIV,QAAQ,EAAE;IACdD,QAAQ,GAAG,CAACD,KAAK,CAAC;EACpB,CAAC;EAED,oBACEJ,IAAA,CAACR,SAAS;IACRyB,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,KAAK,EAAEV,cAAc;MACrBW,MAAM,EAAEZ,SAAS,GAAG,CAAC;MACrBa,YAAY,EAAEb,SAAS,GAAG,CAAC,GAAG,CAAC;MAC/Bc,WAAW,EAAEjB,QAAQ,GAAGE,KAAK,CAACgB,MAAM,CAAClB,QAAQ,GAAGE,KAAK,CAACgB,MAAM,CAACC;IAC/D,CAAC,EACDnB,QAAQ,IAAIY,MAAM,CAACZ,QAAQ,CAC3B;IACFoB,OAAO,EAAEV,WAAY;IACrBV,QAAQ,EAAEA,QAAS;IAAA,GACfC,KAAK;IAAAoB,QAAA,eAET3B,IAAA,CAACJ,QAAQ,CAACgC,IAAI;MACZX,KAAK,EAAE,CACL;QACEG,KAAK,EAAET,SAAS;QAChBU,MAAM,EAAEV,SAAS;QACjBW,YAAY,EAAEX,SAAS,GAAG,CAAC;QAC3BkB,eAAe,EAAEzB,KAAK,GAAGI,KAAK,CAACgB,MAAM,CAACtB,IAAI,CAAC,GAAGM,KAAK,CAACgB,MAAM,CAAClB;MAC7D,CAAC,EACDO,kBAAkB;IAClB,CACH;EAAC,CACO,CAAC;AAEhB;AAEA,MAAMK,MAAM,GAAGzB,UAAU,CAACqC,MAAM,CAAC;EAC/BX,SAAS,EAAE;IACTY,OAAO,EAAE,CAAC;IACVC,cAAc,EAAE,QAAQ;IACxBC,WAAW,EAAE;EACf,CAAC;EACD3B,QAAQ,EAAE;IACR4B,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
- export { CommonText, CommonButton, CommonBadge, SafeAreaContainer, ScrollViewContainer, CommonIcon, CommonRating, CommonAvatar, CommonImage, CheckBox, CommonHeader, CommonCard, FoldableCard, LinearProgressBar, CircularProgressBar, CommonInput, CommonPopOver, CommonSwitch, SocialLoginButton, CommonSpinner, CommonSlider, CommonSelect, SelectItem } from "./components/index.js";
3
+ export { CommonText, CommonButton, CommonBadge, SafeAreaContainer, ScrollViewContainer, CommonIcon, CommonRating, CommonAvatar, CommonImage, CheckBox, CommonHeader, CommonCard, FoldableCard, LinearProgressBar, CircularProgressBar, CommonInput, CommonPopOver, CommonSwitch, SocialLoginButton, CommonSpinner, CommonSlider, CommonSelect, SelectItem, NumberBadge, CommonList, ImageList } from "./components/index.js";
4
4
  export { ThemeProvider } from "./theme/themeProvider.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CommonText","CommonButton","CommonBadge","SafeAreaContainer","ScrollViewContainer","CommonIcon","CommonRating","CommonAvatar","CommonImage","CheckBox","CommonHeader","CommonCard","FoldableCard","LinearProgressBar","CircularProgressBar","CommonInput","CommonPopOver","CommonSwitch","SocialLoginButton","CommonSpinner","CommonSlider","CommonSelect","SelectItem","ThemeProvider"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,YAAY,EACZC,WAAW,EACXC,iBAAiB,EACjBC,mBAAmB,EACnBC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,iBAAiB,EACjBC,mBAAmB,EACnBC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,QACL,uBAAc;AACrB,SAASC,aAAa,QAAQ,0BAAuB","ignoreList":[]}
1
+ {"version":3,"names":["CommonText","CommonButton","CommonBadge","SafeAreaContainer","ScrollViewContainer","CommonIcon","CommonRating","CommonAvatar","CommonImage","CheckBox","CommonHeader","CommonCard","FoldableCard","LinearProgressBar","CircularProgressBar","CommonInput","CommonPopOver","CommonSwitch","SocialLoginButton","CommonSpinner","CommonSlider","CommonSelect","SelectItem","NumberBadge","CommonList","ImageList","ThemeProvider"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,YAAY,EACZC,WAAW,EACXC,iBAAiB,EACjBC,mBAAmB,EACnBC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,iBAAiB,EACjBC,mBAAmB,EACnBC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,SAAS,QACJ,uBAAc;AACrB,SAASC,aAAa,QAAQ,0BAAuB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
1
  import CommonBadge from './commonBadge.js';
2
- export { CommonBadge };
2
+ import NumberBadge from './numberBadge.js';
3
+ export { CommonBadge, NumberBadge };
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAe,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAe,CAAC;AACxC,OAAO,WAAW,MAAM,kBAAe,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { CommonText } from './text/index.js';
2
2
  export { CommonButton, SocialLoginButton } from './button/index.js';
3
- export { CommonBadge } from './badge/index.js';
3
+ export { CommonBadge, NumberBadge } from './badge/index.js';
4
4
  export { SafeAreaContainer, ScrollViewContainer } from './screenContainer/index.js';
5
5
  export { CommonIcon } from './icon/index.js';
6
6
  export { CommonRating } from './rating/index.js';
@@ -16,4 +16,5 @@ export { CommonSwitch } from './switch/index.js';
16
16
  export { CommonSpinner } from './spinner/index.js';
17
17
  export { CommonSlider } from './slider/index.js';
18
18
  export { CommonSelect, SelectItem } from './select/index.js';
19
+ export { CommonList, ImageList } from './list/index.js';
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAU,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAAmB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAQ,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAU,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAAmB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAQ,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAU,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type CommonListProps } from './types.js';
2
+ declare const CommonList: <ItemT>(props: CommonListProps<ItemT>) => import("react").JSX.Element;
3
+ export default CommonList;
4
+ //# sourceMappingURL=commonList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonList.d.ts","sourceRoot":"","sources":["../../../../../src/components/list/commonList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAS,CAAC;AAE/C,QAAA,MAAM,UAAU,GAAI,KAAK,EAAG,OAAO,eAAe,CAAC,KAAK,CAAC,gCAExD,CAAC;AAQF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type CommonListProps } from './types.js';
2
+ declare const ImgList: <ItemT>(props: CommonListProps<ItemT>) => import("react").JSX.Element;
3
+ export default ImgList;
4
+ //# sourceMappingURL=imageList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageList.d.ts","sourceRoot":"","sources":["../../../../../src/components/list/imageList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAS,CAAC;AAG/C,QAAA,MAAM,OAAO,GAAI,KAAK,EAAG,OAAO,eAAe,CAAC,KAAK,CAAC,gCAQrD,CAAC;AAYF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import CommonList from './commonList.js';
2
+ import ImageList from './imageList.js';
3
+ export { CommonList, ImageList };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/list/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,iBAAc,CAAC;AACtC,OAAO,SAAS,MAAM,gBAAa,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type FlatListProps, type ViewStyle } from 'react-native';
2
+ type Variant = 'primary' | 'secondary';
3
+ type SizeVariant = 's' | 'm' | 'l';
4
+ export declare const containerType: Record<Variant, ViewStyle>;
5
+ export interface CommonListProps<ItemT> extends FlatListProps<ItemT> {
6
+ type?: Variant;
7
+ size?: SizeVariant;
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/list/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAElE,KAAK,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AACvC,KAAK,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEnC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,CAGpD,CAAC;AAEF,MAAM,WAAW,eAAe,CAAC,KAAK,CAAE,SAAQ,aAAa,CAAC,KAAK,CAAC;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"circularProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/circularProgressBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,YAAS,CAAC;AAG3E,QAAA,MAAM,mBAAmB,GAAI,wCAM1B,gBAAgB,gCA8ClB,CAAC;AAMF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"circularProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/circularProgressBar.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,YAAS,CAAC;AAK3E,QAAA,MAAM,mBAAmB,GAAI,wCAM1B,gBAAgB,gCA0DlB,CAAC;AAMF,eAAe,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/index.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,wBAAqB,CAAC;AACpD,OAAO,mBAAmB,MAAM,0BAAuB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAqB,CAAC;AACpD,OAAO,mBAAmB,MAAM,0BAAuB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"linearProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/linearProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAGhD,QAAA,MAAM,iBAAiB,GAAI,kCAKxB,gBAAgB,gCA0BlB,CAAC;AAeF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"linearProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/progressBar/linearProgressBar.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAGhD,QAAA,MAAM,iBAAiB,GAAI,kCAKxB,gBAAgB,gCA0ClB,CAAC;AAeF,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"commonSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/switch/commonSwitch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,YAAS,CAAC;AAIrD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,IAAgB,EAChB,IAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,WAAW,+BAoDb"}
1
+ {"version":3,"file":"commonSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/switch/commonSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,YAAS,CAAC;AAOrD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,IAAgB,EAChB,IAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,WAAW,+BAsDb"}
@@ -1,3 +1,3 @@
1
- export { CommonText, CommonButton, CommonBadge, SafeAreaContainer, ScrollViewContainer, CommonIcon, CommonRating, CommonAvatar, CommonImage, CheckBox, CommonHeader, CommonCard, FoldableCard, LinearProgressBar, CircularProgressBar, CommonInput, CommonPopOver, CommonSwitch, SocialLoginButton, CommonSpinner, CommonSlider, CommonSelect, SelectItem, } from './components/index.js';
1
+ export { CommonText, CommonButton, CommonBadge, SafeAreaContainer, ScrollViewContainer, CommonIcon, CommonRating, CommonAvatar, CommonImage, CheckBox, CommonHeader, CommonCard, FoldableCard, LinearProgressBar, CircularProgressBar, CommonInput, CommonPopOver, CommonSwitch, SocialLoginButton, CommonSpinner, CommonSlider, CommonSelect, SelectItem, NumberBadge, CommonList, ImageList, } from './components/index.js';
2
2
  export { ThemeProvider } from './theme/themeProvider.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,uBAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,GACV,MAAM,uBAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kukkim/react-native-ui",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "ui library for react native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -1,3 +1,4 @@
1
1
  import CommonBadge from './commonBadge';
2
+ import NumberBadge from './numberBadge';
2
3
 
3
- export { CommonBadge };
4
+ export { CommonBadge, NumberBadge };
@@ -1,6 +1,6 @@
1
1
  export { CommonText } from './text';
2
2
  export { CommonButton, SocialLoginButton } from './button';
3
- export { CommonBadge } from './badge';
3
+ export { CommonBadge, NumberBadge } from './badge';
4
4
  export { SafeAreaContainer, ScrollViewContainer } from './screenContainer';
5
5
  export { CommonIcon } from './icon';
6
6
  export { CommonRating } from './rating';
@@ -16,3 +16,4 @@ export { CommonSwitch } from './switch';
16
16
  export { CommonSpinner } from './spinner';
17
17
  export { CommonSlider } from './slider';
18
18
  export { CommonSelect, SelectItem } from './select';
19
+ export { CommonList, ImageList } from './list';
@@ -0,0 +1,14 @@
1
+ import { FlatList, StyleSheet } from 'react-native';
2
+ import { type CommonListProps } from './types';
3
+
4
+ const CommonList = <ItemT,>(props: CommonListProps<ItemT>) => {
5
+ return <FlatList style={styles.container} {...props} />;
6
+ };
7
+
8
+ const styles = StyleSheet.create({
9
+ container: {
10
+ flex: 1,
11
+ },
12
+ });
13
+
14
+ export default CommonList;
@@ -0,0 +1,25 @@
1
+ import { FlatList, StyleSheet } from 'react-native';
2
+ import { type CommonListProps } from './types';
3
+ // import { CommonImage } from "../image";
4
+
5
+ const ImgList = <ItemT,>(props: CommonListProps<ItemT>) => {
6
+ return (
7
+ <FlatList
8
+ style={styles.container}
9
+ // renderItem={({ item }) => <CommonImage title={item.title} />}
10
+ {...props}
11
+ />
12
+ );
13
+ };
14
+
15
+ const styles = StyleSheet.create({
16
+ container: {
17
+ width: 'auto',
18
+ margin: 5,
19
+ padding: 5,
20
+ borderWidth: 1,
21
+ borderRadius: 3,
22
+ },
23
+ });
24
+
25
+ export default ImgList;
@@ -0,0 +1,4 @@
1
+ import CommonList from './commonList';
2
+ import ImageList from './imageList';
3
+
4
+ export { CommonList, ImageList };
@@ -0,0 +1,14 @@
1
+ import { type FlatListProps, type ViewStyle } from 'react-native';
2
+
3
+ type Variant = 'primary' | 'secondary';
4
+ type SizeVariant = 's' | 'm' | 'l';
5
+
6
+ export const containerType: Record<Variant, ViewStyle> = {
7
+ primary: {},
8
+ secondary: {},
9
+ };
10
+
11
+ export interface CommonListProps<ItemT> extends FlatListProps<ItemT> {
12
+ type?: Variant;
13
+ size?: SizeVariant;
14
+ }
@@ -1,8 +1,16 @@
1
+ import { useEffect } from 'react';
1
2
  import { StyleSheet, View } from 'react-native';
2
3
  import Svg, { Circle } from 'react-native-svg';
4
+ import Animated, {
5
+ useAnimatedProps,
6
+ useSharedValue,
7
+ withTiming,
8
+ } from 'react-native-reanimated';
3
9
  import { type ProgressBarProps, sizeType, strokeWidthType } from './types';
4
10
  import { useTheme } from '../../hooks/useTheme';
5
11
 
12
+ const AnimatedCircle = Animated.createAnimatedComponent(Circle);
13
+
6
14
  const CircularProgressBar = ({
7
15
  type = 'primary',
8
16
  size = 'm',
@@ -20,7 +28,19 @@ const CircularProgressBar = ({
20
28
  const radius = (svgSize - strokeWidth) / 2;
21
29
  const circumference = 2 * Math.PI * radius;
22
30
 
23
- const strokeDashoffset = circumference * (1 - progress);
31
+ const animatedProgress = useSharedValue(0);
32
+
33
+ useEffect(() => {
34
+ animatedProgress.value = withTiming(progress, {
35
+ duration: 500,
36
+ });
37
+ }, [progress, animatedProgress]);
38
+
39
+ const animatedProps = useAnimatedProps(() => {
40
+ return {
41
+ strokeDashoffset: circumference * (1 - animatedProgress.value),
42
+ };
43
+ });
24
44
 
25
45
  return (
26
46
  <View style={[styles.container, style]} {...props}>
@@ -38,7 +58,7 @@ const CircularProgressBar = ({
38
58
  fill="none"
39
59
  />
40
60
 
41
- <Circle
61
+ <AnimatedCircle
42
62
  cx={svgSize / 2}
43
63
  cy={svgSize / 2}
44
64
  r={radius}
@@ -47,7 +67,7 @@ const CircularProgressBar = ({
47
67
  fill="none"
48
68
  strokeLinecap="round"
49
69
  strokeDasharray={circumference}
50
- strokeDashoffset={strokeDashoffset}
70
+ animatedProps={animatedProps}
51
71
  rotation="-90"
52
72
  originX={svgSize / 2}
53
73
  originY={svgSize / 2}
@@ -1,4 +1,3 @@
1
- // TODO: progressbar에 react-native-reanimated를 이용한 animation적용 필요.
2
1
  import LinearProgressBar from './linearProgressBar';
3
2
  import CircularProgressBar from './circularProgressBar';
4
3
 
@@ -1,4 +1,9 @@
1
- import { StyleSheet, View } from 'react-native';
1
+ import { useState } from 'react';
2
+ import { StyleSheet, View, type LayoutChangeEvent } from 'react-native';
3
+ import Animated, {
4
+ useAnimatedStyle,
5
+ withTiming,
6
+ } from 'react-native-reanimated';
2
7
  import { type ProgressBarProps } from './types';
3
8
  import { useTheme } from '../../hooks/useTheme';
4
9
 
@@ -11,6 +16,18 @@ const LinearProgressBar = ({
11
16
  const { theme } = useTheme();
12
17
  const progress = Math.min(Math.max(value, 0), 1);
13
18
 
19
+ const [containerWidth, setContainerWidth] = useState(0);
20
+
21
+ const animatedStyle = useAnimatedStyle(() => ({
22
+ width: withTiming(containerWidth * progress, {
23
+ duration: 1000,
24
+ }),
25
+ }));
26
+
27
+ const onLayout = (e: LayoutChangeEvent) => {
28
+ setContainerWidth(e.nativeEvent.layout.width);
29
+ };
30
+
14
31
  return (
15
32
  <View
16
33
  style={[
@@ -20,17 +37,21 @@ const LinearProgressBar = ({
20
37
  },
21
38
  style,
22
39
  ]}
40
+ onLayout={onLayout}
23
41
  {...props}
24
42
  >
25
- <View
26
- style={[
27
- styles.progress,
28
- {
29
- width: `${progress * 100}%`,
30
- backgroundColor: theme.colors[type],
31
- },
32
- ]}
33
- />
43
+ {containerWidth > 0 && (
44
+ <Animated.View
45
+ style={[
46
+ styles.progress,
47
+ {
48
+ width: containerWidth,
49
+ backgroundColor: theme.colors[type],
50
+ },
51
+ animatedStyle,
52
+ ]}
53
+ />
54
+ )}
34
55
  </View>
35
56
  );
36
57
  };
@@ -1,9 +1,11 @@
1
- import { useEffect, useRef } from 'react';
2
- import { Animated, Pressable, StyleSheet } from 'react-native';
1
+ import { Pressable, StyleSheet } from 'react-native';
3
2
  import { type SwitchProps, sizeType } from './types';
4
3
  import { useTheme } from '../../hooks/useTheme';
4
+ import Animated, {
5
+ useAnimatedStyle,
6
+ withTiming,
7
+ } from 'react-native-reanimated';
5
8
 
6
- //TODO: react-native-reanimated로 수정필요
7
9
  export default function CommonSwitch({
8
10
  type = 'primary',
9
11
  size = 'm',
@@ -14,20 +16,22 @@ export default function CommonSwitch({
14
16
  }: SwitchProps) {
15
17
  const { theme } = useTheme();
16
18
 
17
- const animValue = useRef(new Animated.Value(value ? 1 : 0)).current;
18
-
19
19
  const sizeValue = sizeType[size];
20
20
  const containerWidth = (sizeValue + 2) * 2;
21
21
  const thumbSize = sizeValue;
22
22
  const translateX = containerWidth - thumbSize - 2;
23
23
 
24
- useEffect(() => {
25
- Animated.timing(animValue, {
26
- toValue: value ? translateX : 0,
27
- duration: 200,
28
- useNativeDriver: true,
29
- }).start();
30
- }, [value, translateX, animValue]);
24
+ const thumbAnimatedStyle = useAnimatedStyle(() => {
25
+ return {
26
+ transform: [
27
+ {
28
+ translateX: withTiming(value ? translateX : 0, {
29
+ duration: 200,
30
+ }),
31
+ },
32
+ ],
33
+ };
34
+ }, [value, translateX]);
31
35
 
32
36
  const toggleValue = () => {
33
37
  if (disabled) return;
@@ -57,8 +61,8 @@ export default function CommonSwitch({
57
61
  height: thumbSize,
58
62
  borderRadius: thumbSize / 2,
59
63
  backgroundColor: value ? theme.colors[type] : theme.colors.disabled,
60
- transform: [{ translateX: animValue }],
61
64
  },
65
+ thumbAnimatedStyle,
62
66
  ]}
63
67
  />
64
68
  </Pressable>
package/src/index.tsx CHANGED
@@ -22,5 +22,8 @@ export {
22
22
  CommonSlider,
23
23
  CommonSelect,
24
24
  SelectItem,
25
+ NumberBadge,
26
+ CommonList,
27
+ ImageList,
25
28
  } from './components';
26
29
  export { ThemeProvider } from './theme/themeProvider';