@toankhontech/arctimer-expo 0.0.0

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/app.plugin.js ADDED
@@ -0,0 +1,3 @@
1
+ // Expo config plugin for @toankhontech/arctimer-expo
2
+ // Currently a no-op since react-native-svg auto-links in Expo
3
+ module.exports = (config) => config
package/dist/index.cjs ADDED
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ var arctimerReactNative = require('@toankhontech/arctimer-react-native');
4
+ var arctimerThemes = require('@toankhontech/arctimer-themes');
5
+ var react = require('react');
6
+ var reactNative = require('react-native');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ // src/index.ts
10
+ function ExpoTimerProvider({
11
+ theme = "auto",
12
+ pauseOnBackground = true,
13
+ children
14
+ }) {
15
+ const appStateRef = react.useRef(reactNative.AppState.currentState);
16
+ react.useEffect(() => {
17
+ if (!pauseOnBackground) return;
18
+ const handleAppStateChange = (nextAppState) => {
19
+ appStateRef.current = nextAppState;
20
+ };
21
+ const subscription = reactNative.AppState.addEventListener(
22
+ "change",
23
+ handleAppStateChange
24
+ );
25
+ return () => {
26
+ subscription.remove();
27
+ };
28
+ }, [pauseOnBackground]);
29
+ return /* @__PURE__ */ jsxRuntime.jsx(arctimerThemes.TimerThemeProvider, { theme, children });
30
+ }
31
+
32
+ Object.defineProperty(exports, "CountdownCircleTimer", {
33
+ enumerable: true,
34
+ get: function () { return arctimerReactNative.CountdownCircleTimer; }
35
+ });
36
+ Object.defineProperty(exports, "TimerGroup", {
37
+ enumerable: true,
38
+ get: function () { return arctimerReactNative.TimerGroup; }
39
+ });
40
+ Object.defineProperty(exports, "useCountdown", {
41
+ enumerable: true,
42
+ get: function () { return arctimerReactNative.useCountdown; }
43
+ });
44
+ Object.defineProperty(exports, "useReducedMotion", {
45
+ enumerable: true,
46
+ get: function () { return arctimerReactNative.useReducedMotion; }
47
+ });
48
+ Object.defineProperty(exports, "useTimerGroup", {
49
+ enumerable: true,
50
+ get: function () { return arctimerReactNative.useTimerGroup; }
51
+ });
52
+ Object.defineProperty(exports, "TimerThemeProvider", {
53
+ enumerable: true,
54
+ get: function () { return arctimerThemes.TimerThemeProvider; }
55
+ });
56
+ Object.defineProperty(exports, "createTheme", {
57
+ enumerable: true,
58
+ get: function () { return arctimerThemes.createTheme; }
59
+ });
60
+ Object.defineProperty(exports, "darkTheme", {
61
+ enumerable: true,
62
+ get: function () { return arctimerThemes.darkTheme; }
63
+ });
64
+ Object.defineProperty(exports, "defaultTheme", {
65
+ enumerable: true,
66
+ get: function () { return arctimerThemes.defaultTheme; }
67
+ });
68
+ Object.defineProperty(exports, "minimalTheme", {
69
+ enumerable: true,
70
+ get: function () { return arctimerThemes.minimalTheme; }
71
+ });
72
+ Object.defineProperty(exports, "neonTheme", {
73
+ enumerable: true,
74
+ get: function () { return arctimerThemes.neonTheme; }
75
+ });
76
+ Object.defineProperty(exports, "useTimerTheme", {
77
+ enumerable: true,
78
+ get: function () { return arctimerThemes.useTimerTheme; }
79
+ });
80
+ Object.defineProperty(exports, "vibrantTheme", {
81
+ enumerable: true,
82
+ get: function () { return arctimerThemes.vibrantTheme; }
83
+ });
84
+ exports.ExpoTimerProvider = ExpoTimerProvider;
85
+ //# sourceMappingURL=index.cjs.map
86
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ExpoTimerProvider.tsx"],"names":["useRef","AppState","useEffect","jsx","TimerThemeProvider"],"mappings":";;;;;;;;;AAcO,SAAS,iBAAA,CAAkB;AAAA,EAChC,KAAA,GAAQ,MAAA;AAAA,EACR,iBAAA,GAAoB,IAAA;AAAA,EACpB;AACF,CAAA,EAA2B;AACzB,EAAA,MAAM,WAAA,GAAcA,YAAA,CAAOC,oBAAA,CAAS,YAAY,CAAA;AAEhD,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,iBAAA,EAAmB;AAExB,IAAA,MAAM,oBAAA,GAAuB,CAAC,YAAA,KAAiC;AAC7D,MAAA,WAAA,CAAY,OAAA,GAAU,YAAA;AAAA,IACxB,CAAA;AAEA,IAAA,MAAM,eAAeD,oBAAA,CAAS,gBAAA;AAAA,MAC5B,QAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,YAAA,CAAa,MAAA,EAAO;AAAA,IACtB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,iBAAiB,CAAC,CAAA;AAEtB,EAAA,uBACEE,cAAA,CAACC,iCAAA,EAAA,EAAmB,KAAA,EACjB,QAAA,EACH,CAAA;AAEJ","file":"index.cjs","sourcesContent":["import { useEffect, useRef } from 'react'\nimport { AppState } from 'react-native'\nimport type { AppStateStatus } from 'react-native'\nimport {\n TimerThemeProvider,\n type ThemeProp,\n} from '@toankhontech/arctimer-themes'\n\nexport interface ExpoTimerProviderProps {\n theme?: ThemeProp\n pauseOnBackground?: boolean\n children: React.ReactNode\n}\n\nexport function ExpoTimerProvider({\n theme = 'auto',\n pauseOnBackground = true,\n children,\n}: ExpoTimerProviderProps) {\n const appStateRef = useRef(AppState.currentState)\n\n useEffect(() => {\n if (!pauseOnBackground) return\n\n const handleAppStateChange = (nextAppState: AppStateStatus) => {\n appStateRef.current = nextAppState\n }\n\n const subscription = AppState.addEventListener(\n 'change',\n handleAppStateChange\n )\n\n return () => {\n subscription.remove()\n }\n }, [pauseOnBackground])\n\n return (\n <TimerThemeProvider theme={theme}>\n {children}\n </TimerThemeProvider>\n )\n}\n"]}
@@ -0,0 +1,13 @@
1
+ export { Color, ColorFormat, CountdownCircleTimer, CountdownCircleTimerProps, CountdownProps, EasingConfig, EasingName, OnCompleteResult, RenderInfo, Rotation, Theme, TimerGroup, TimerGroupProps, TimerGroupRef, TimerRef, TimerStatus, UseCountdownReturn, UseTimerGroupReturn, useCountdown, useReducedMotion, useTimerGroup } from '@toankhontech/arctimer-react-native';
2
+ import { ThemeProp } from '@toankhontech/arctimer-themes';
3
+ export { TimerThemeProvider, createTheme, darkTheme, defaultTheme, minimalTheme, neonTheme, useTimerTheme, vibrantTheme } from '@toankhontech/arctimer-themes';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+
6
+ interface ExpoTimerProviderProps {
7
+ theme?: ThemeProp;
8
+ pauseOnBackground?: boolean;
9
+ children: React.ReactNode;
10
+ }
11
+ declare function ExpoTimerProvider({ theme, pauseOnBackground, children, }: ExpoTimerProviderProps): react_jsx_runtime.JSX.Element;
12
+
13
+ export { ExpoTimerProvider, type ExpoTimerProviderProps };
@@ -0,0 +1,13 @@
1
+ export { Color, ColorFormat, CountdownCircleTimer, CountdownCircleTimerProps, CountdownProps, EasingConfig, EasingName, OnCompleteResult, RenderInfo, Rotation, Theme, TimerGroup, TimerGroupProps, TimerGroupRef, TimerRef, TimerStatus, UseCountdownReturn, UseTimerGroupReturn, useCountdown, useReducedMotion, useTimerGroup } from '@toankhontech/arctimer-react-native';
2
+ import { ThemeProp } from '@toankhontech/arctimer-themes';
3
+ export { TimerThemeProvider, createTheme, darkTheme, defaultTheme, minimalTheme, neonTheme, useTimerTheme, vibrantTheme } from '@toankhontech/arctimer-themes';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+
6
+ interface ExpoTimerProviderProps {
7
+ theme?: ThemeProp;
8
+ pauseOnBackground?: boolean;
9
+ children: React.ReactNode;
10
+ }
11
+ declare function ExpoTimerProvider({ theme, pauseOnBackground, children, }: ExpoTimerProviderProps): react_jsx_runtime.JSX.Element;
12
+
13
+ export { ExpoTimerProvider, type ExpoTimerProviderProps };
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ export { CountdownCircleTimer, TimerGroup, useCountdown, useReducedMotion, useTimerGroup } from '@toankhontech/arctimer-react-native';
2
+ import { TimerThemeProvider } from '@toankhontech/arctimer-themes';
3
+ export { TimerThemeProvider, createTheme, darkTheme, defaultTheme, minimalTheme, neonTheme, useTimerTheme, vibrantTheme } from '@toankhontech/arctimer-themes';
4
+ import { useRef, useEffect } from 'react';
5
+ import { AppState } from 'react-native';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ // src/index.ts
9
+ function ExpoTimerProvider({
10
+ theme = "auto",
11
+ pauseOnBackground = true,
12
+ children
13
+ }) {
14
+ const appStateRef = useRef(AppState.currentState);
15
+ useEffect(() => {
16
+ if (!pauseOnBackground) return;
17
+ const handleAppStateChange = (nextAppState) => {
18
+ appStateRef.current = nextAppState;
19
+ };
20
+ const subscription = AppState.addEventListener(
21
+ "change",
22
+ handleAppStateChange
23
+ );
24
+ return () => {
25
+ subscription.remove();
26
+ };
27
+ }, [pauseOnBackground]);
28
+ return /* @__PURE__ */ jsx(TimerThemeProvider, { theme, children });
29
+ }
30
+
31
+ export { ExpoTimerProvider };
32
+ //# sourceMappingURL=index.js.map
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ExpoTimerProvider.tsx"],"names":[],"mappings":";;;;;;;;AAcO,SAAS,iBAAA,CAAkB;AAAA,EAChC,KAAA,GAAQ,MAAA;AAAA,EACR,iBAAA,GAAoB,IAAA;AAAA,EACpB;AACF,CAAA,EAA2B;AACzB,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,QAAA,CAAS,YAAY,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,iBAAA,EAAmB;AAExB,IAAA,MAAM,oBAAA,GAAuB,CAAC,YAAA,KAAiC;AAC7D,MAAA,WAAA,CAAY,OAAA,GAAU,YAAA;AAAA,IACxB,CAAA;AAEA,IAAA,MAAM,eAAe,QAAA,CAAS,gBAAA;AAAA,MAC5B,QAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,YAAA,CAAa,MAAA,EAAO;AAAA,IACtB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,iBAAiB,CAAC,CAAA;AAEtB,EAAA,uBACE,GAAA,CAAC,kBAAA,EAAA,EAAmB,KAAA,EACjB,QAAA,EACH,CAAA;AAEJ","file":"index.js","sourcesContent":["import { useEffect, useRef } from 'react'\nimport { AppState } from 'react-native'\nimport type { AppStateStatus } from 'react-native'\nimport {\n TimerThemeProvider,\n type ThemeProp,\n} from '@toankhontech/arctimer-themes'\n\nexport interface ExpoTimerProviderProps {\n theme?: ThemeProp\n pauseOnBackground?: boolean\n children: React.ReactNode\n}\n\nexport function ExpoTimerProvider({\n theme = 'auto',\n pauseOnBackground = true,\n children,\n}: ExpoTimerProviderProps) {\n const appStateRef = useRef(AppState.currentState)\n\n useEffect(() => {\n if (!pauseOnBackground) return\n\n const handleAppStateChange = (nextAppState: AppStateStatus) => {\n appStateRef.current = nextAppState\n }\n\n const subscription = AppState.addEventListener(\n 'change',\n handleAppStateChange\n )\n\n return () => {\n subscription.remove()\n }\n }, [pauseOnBackground])\n\n return (\n <TimerThemeProvider theme={theme}>\n {children}\n </TimerThemeProvider>\n )\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@toankhontech/arctimer-expo",
3
+ "version": "0.0.0",
4
+ "description": "Expo wrapper for ArcTimer with auto-linking and Expo optimizations",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": ["dist", "README.md", "app.plugin.js"],
22
+ "sideEffects": false,
23
+ "scripts": {
24
+ "build": "tsup",
25
+ "dev": "tsup --watch",
26
+ "typecheck": "tsc --noEmit",
27
+ "clean": "rm -rf dist .turbo"
28
+ },
29
+ "dependencies": {
30
+ "@toankhontech/arctimer-react-native": "workspace:*",
31
+ "@toankhontech/arctimer-themes": "workspace:*"
32
+ },
33
+ "devDependencies": {
34
+ "tsup": "^8.3.0",
35
+ "typescript": "^5.6.0",
36
+ "@types/react": "^19.0.0"
37
+ },
38
+ "peerDependencies": {
39
+ "expo": ">=49.0.0",
40
+ "react": ">=18.0.0",
41
+ "react-native": ">=0.72.0",
42
+ "react-native-svg": ">=13.0.0"
43
+ },
44
+ "keywords": ["expo", "countdown", "timer", "circle", "react-native"],
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/toankhontech/arc-timer.git",
48
+ "directory": "packages/expo"
49
+ },
50
+ "homepage": "https://github.com/toankhontech/arc-timer",
51
+ "bugs": {
52
+ "url": "https://github.com/toankhontech/arc-timer/issues"
53
+ },
54
+ "author": "toankhontech",
55
+ "license": "MIT"
56
+ }