@rific/timer 0.1.3 → 0.1.4

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/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
2
3
  import { ViewStyle } from 'react-native';
3
4
 
4
5
  type TimerProps = {
@@ -13,6 +14,6 @@ type TimerProps = {
13
14
  style?: ViewStyle;
14
15
  width?: number;
15
16
  };
16
- declare const Timer: ({ children, color, duration, onStart, onStop, radius, startProgress, started, style, width }: TimerProps) => React.JSX.Element;
17
+ declare const Timer: ({ children, color, duration, onStart, onStop, radius, startProgress, started, style, width }: TimerProps) => react_jsx_runtime.JSX.Element;
17
18
 
18
19
  export { Timer, type TimerProps };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
2
3
  import { ViewStyle } from 'react-native';
3
4
 
4
5
  type TimerProps = {
@@ -13,6 +14,6 @@ type TimerProps = {
13
14
  style?: ViewStyle;
14
15
  width?: number;
15
16
  };
16
- declare const Timer: ({ children, color, duration, onStart, onStop, radius, startProgress, started, style, width }: TimerProps) => React.JSX.Element;
17
+ declare const Timer: ({ children, color, duration, onStart, onStop, radius, startProgress, started, style, width }: TimerProps) => react_jsx_runtime.JSX.Element;
17
18
 
18
19
  export { Timer, type TimerProps };
package/dist/index.js CHANGED
@@ -35,9 +35,10 @@ __export(index_exports, {
35
35
  module.exports = __toCommonJS(index_exports);
36
36
 
37
37
  // src/Timer.tsx
38
- var import_react = __toESM(require("react"));
38
+ var import_react = require("react");
39
39
  var import_react_native = require("react-native");
40
40
  var import_react_native_svg = __toESM(require("react-native-svg"));
41
+ var import_jsx_runtime = require("react/jsx-runtime");
41
42
  var AnimatedCircle = import_react_native.Animated.createAnimatedComponent(import_react_native_svg.Circle);
42
43
  var useNativeDriver = true;
43
44
  var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress = 0, started, style, width = 6 }) => {
@@ -97,7 +98,10 @@ var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress
97
98
  progressRef.current = startProgress;
98
99
  startedRef.current = started;
99
100
  }, [animation, duration, startProgress, started, startTimer, stopTimer]);
100
- return /* @__PURE__ */ import_react.default.createElement(import_react_native.View, { style: [style, styles.root] }, /* @__PURE__ */ import_react.default.createElement(import_react_native_svg.default, { width: radius * 2 + width, height: radius * 2 + width, viewBox: `0 0 ${radius * 2 + width} ${radius * 2 + width}`, style: styles.svg }, /* @__PURE__ */ import_react.default.createElement(import_react_native_svg.G, { rotation: "-90", origin: `${radius + width / 2}, ${radius + width / 2}` }, /* @__PURE__ */ import_react.default.createElement(AnimatedCircle, { cx: radius + width / 2, cy: radius + width / 2, r: radius, stroke: color, strokeWidth: width, fill: "none", strokeDasharray: circumference, ...animatedProps }))), /* @__PURE__ */ import_react.default.createElement(import_react_native.View, { style: styles.children }, children));
101
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: [style, styles.root], children: [
102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native_svg.default, { width: radius * 2 + width, height: radius * 2 + width, viewBox: `0 0 ${radius * 2 + width} ${radius * 2 + width}`, style: styles.svg, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native_svg.G, { rotation: "-90", origin: `${radius + width / 2}, ${radius + width / 2}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnimatedCircle, { cx: radius + width / 2, cy: radius + width / 2, r: radius, stroke: color, strokeWidth: width, fill: "none", strokeDasharray: circumference, ...animatedProps }) }) }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: styles.children, children })
104
+ ] });
101
105
  };
102
106
  var styles = import_react_native.StyleSheet.create({
103
107
  children: {
package/dist/index.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  // src/Timer.tsx
2
- import React, { useCallback, useEffect, useRef } from "react";
2
+ import { useCallback, useEffect, useRef } from "react";
3
3
  import { Animated, Easing, StyleSheet, View } from "react-native";
4
4
  import Svg, { Circle, G } from "react-native-svg";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
5
6
  var AnimatedCircle = Animated.createAnimatedComponent(Circle);
6
7
  var useNativeDriver = true;
7
8
  var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress = 0, started, style, width = 6 }) => {
@@ -61,7 +62,10 @@ var Timer = ({ children, color, duration, onStart, onStop, radius, startProgress
61
62
  progressRef.current = startProgress;
62
63
  startedRef.current = started;
63
64
  }, [animation, duration, startProgress, started, startTimer, stopTimer]);
64
- return /* @__PURE__ */ React.createElement(View, { style: [style, styles.root] }, /* @__PURE__ */ React.createElement(Svg, { width: radius * 2 + width, height: radius * 2 + width, viewBox: `0 0 ${radius * 2 + width} ${radius * 2 + width}`, style: styles.svg }, /* @__PURE__ */ React.createElement(G, { rotation: "-90", origin: `${radius + width / 2}, ${radius + width / 2}` }, /* @__PURE__ */ React.createElement(AnimatedCircle, { cx: radius + width / 2, cy: radius + width / 2, r: radius, stroke: color, strokeWidth: width, fill: "none", strokeDasharray: circumference, ...animatedProps }))), /* @__PURE__ */ React.createElement(View, { style: styles.children }, children));
65
+ return /* @__PURE__ */ jsxs(View, { style: [style, styles.root], children: [
66
+ /* @__PURE__ */ jsx(Svg, { width: radius * 2 + width, height: radius * 2 + width, viewBox: `0 0 ${radius * 2 + width} ${radius * 2 + width}`, style: styles.svg, children: /* @__PURE__ */ jsx(G, { rotation: "-90", origin: `${radius + width / 2}, ${radius + width / 2}`, children: /* @__PURE__ */ jsx(AnimatedCircle, { cx: radius + width / 2, cy: radius + width / 2, r: radius, stroke: color, strokeWidth: width, fill: "none", strokeDasharray: circumference, ...animatedProps }) }) }),
67
+ /* @__PURE__ */ jsx(View, { style: styles.children, children })
68
+ ] });
65
69
  };
66
70
  var styles = StyleSheet.create({
67
71
  children: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rific/timer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Animated SVG progress ring timer for React Native",
5
5
  "keywords": [
6
6
  "react-native",