reactnatively 1.0.0 → 2.1.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/README.md +48 -45
- package/dist/animations.d.mts +59 -0
- package/dist/animations.d.ts +59 -0
- package/dist/animations.js +36 -0
- package/dist/animations.js.map +1 -0
- package/dist/animations.mjs +5 -0
- package/dist/animations.mjs.map +1 -0
- package/dist/chunk-BJTO5JO5.mjs +10 -0
- package/dist/chunk-BJTO5JO5.mjs.map +1 -0
- package/dist/chunk-DGUM43GV.js +12 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-N2PBBXCI.js +12545 -0
- package/dist/chunk-N2PBBXCI.js.map +1 -0
- package/dist/chunk-STYEL3E3.mjs +12098 -0
- package/dist/chunk-STYEL3E3.mjs.map +1 -0
- package/dist/glass.d.mts +155 -0
- package/dist/glass.d.ts +155 -0
- package/dist/glass.js +94 -0
- package/dist/glass.js.map +1 -0
- package/dist/glass.mjs +5 -0
- package/dist/glass.mjs.map +1 -0
- package/dist/hooks.d.mts +6 -0
- package/dist/hooks.d.ts +6 -0
- package/dist/hooks.js +75 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hooks.mjs +8 -0
- package/dist/hooks.mjs.map +1 -0
- package/dist/index.d.mts +7 -206
- package/dist/index.d.ts +7 -206
- package/dist/index.js +587 -12276
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -12099
- package/dist/index.mjs.map +1 -1
- package/dist/primitives.d.mts +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/primitives.js +53 -0
- package/dist/primitives.js.map +1 -0
- package/dist/primitives.mjs +4 -0
- package/dist/primitives.mjs.map +1 -0
- package/dist/theme.d.mts +1 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +14 -0
- package/dist/theme.js.map +1 -0
- package/dist/theme.mjs +3 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/utils.d.mts +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +14 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +3 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +37 -7
package/README.md
CHANGED
|
@@ -1,61 +1,64 @@
|
|
|
1
|
-
# reactnatively
|
|
1
|
+
# reactnatively
|
|
2
|
+
|
|
3
|
+
Source for the public `reactnatively` package.
|
|
4
|
+
|
|
5
|
+
Consumers should normally import everything from this package:
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import {
|
|
9
|
+
ReactnativelyProvider,
|
|
10
|
+
Button,
|
|
11
|
+
Card,
|
|
12
|
+
GlassView,
|
|
13
|
+
Surface,
|
|
14
|
+
GlassPressable,
|
|
15
|
+
useGlassStyle,
|
|
16
|
+
resolveGlass,
|
|
17
|
+
} from 'reactnatively';
|
|
18
|
+
```
|
|
2
19
|
|
|
3
|
-
|
|
20
|
+
## Optional Subpaths
|
|
4
21
|
|
|
5
|
-
|
|
22
|
+
The package also exposes focused secondary entry points:
|
|
6
23
|
|
|
7
|
-
```
|
|
8
|
-
|
|
24
|
+
```tsx
|
|
25
|
+
import { GlassView } from 'reactnatively/glass';
|
|
26
|
+
import { useDisclosure } from 'reactnatively/hooks';
|
|
27
|
+
import { Fade } from 'reactnatively/animations';
|
|
28
|
+
import { createTheme } from 'reactnatively/theme';
|
|
29
|
+
import { Surface } from 'reactnatively/primitives';
|
|
30
|
+
import { deepMerge } from 'reactnatively/utils';
|
|
9
31
|
```
|
|
10
32
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
---
|
|
33
|
+
These subpaths are for power users and docs organization. The primary API is
|
|
34
|
+
still the root `reactnatively` import.
|
|
14
35
|
|
|
15
36
|
## Architecture
|
|
16
37
|
|
|
17
|
-
`reactnatively`
|
|
38
|
+
`reactnatively` re-exports and composes the workspace packages:
|
|
18
39
|
|
|
19
|
-
|
|
|
40
|
+
| Workspace package | Responsibility |
|
|
20
41
|
|---|---|
|
|
21
|
-
| `reactnatively-glass` |
|
|
22
|
-
| `reactnatively-theme` |
|
|
23
|
-
| `reactnatively-animations` |
|
|
24
|
-
| `reactnatively-primitives` | Surface, GlassPressable,
|
|
25
|
-
| `reactnatively-hooks` |
|
|
26
|
-
| `reactnatively-utils` |
|
|
27
|
-
|
|
28
|
-
The internal packages are **not published to npm** — they exist only to keep the monorepo modular during development. Everything a consumer needs ships inside `reactnatively`.
|
|
29
|
-
|
|
30
|
-
---
|
|
42
|
+
| `reactnatively-glass` | Glass renderer and platform policy |
|
|
43
|
+
| `reactnatively-theme` | Tokens, themes, recipe engine |
|
|
44
|
+
| `reactnatively-animations` | Motion presets, hooks, interaction policy |
|
|
45
|
+
| `reactnatively-primitives` | Surface, GlassPressable, portals, accessibility |
|
|
46
|
+
| `reactnatively-hooks` | Shared UI hooks |
|
|
47
|
+
| `reactnatively-utils` | Utility and type helpers |
|
|
31
48
|
|
|
32
|
-
##
|
|
49
|
+
## Build
|
|
33
50
|
|
|
34
51
|
```sh
|
|
35
|
-
pnpm
|
|
36
|
-
pnpm --filter reactnatively build
|
|
52
|
+
pnpm --filter reactnatively typecheck
|
|
53
|
+
pnpm --filter reactnatively build
|
|
37
54
|
```
|
|
38
55
|
|
|
39
|
-
|
|
56
|
+
The build emits:
|
|
40
57
|
|
|
41
|
-
- `dist/index
|
|
42
|
-
- `dist/
|
|
43
|
-
- `dist/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
src/
|
|
49
|
-
components/
|
|
50
|
-
inputs/ # Button, IconButton, FAB
|
|
51
|
-
forms/ # TextInput, Select, DatePicker, …
|
|
52
|
-
layout/ # Box, Stack, Grid, Divider, …
|
|
53
|
-
typography/ # Heading, Text, Caption, …
|
|
54
|
-
data-display/ # LiquidCard, Avatar, Badge, Chip, …
|
|
55
|
-
feedback/ # Toast, Alert, Skeleton, Dialog, …
|
|
56
|
-
navigation/ # Tabs, BottomNavigation, Drawer, …
|
|
57
|
-
overlays/ # Modal, ActionSheet, CommandPalette, …
|
|
58
|
-
motion/ # Fade, Scale, Slide, MagneticPressable
|
|
59
|
-
glass-advanced/ # GlassNavbar, FloatingDock, DynamicIsland, …
|
|
60
|
-
index.ts # single export barrel
|
|
61
|
-
```
|
|
58
|
+
- `dist/index.*` for the root API
|
|
59
|
+
- `dist/glass.*`
|
|
60
|
+
- `dist/hooks.*`
|
|
61
|
+
- `dist/animations.*`
|
|
62
|
+
- `dist/theme.*`
|
|
63
|
+
- `dist/primitives.*`
|
|
64
|
+
- `dist/utils.*`
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export * from 'reactnatively-animations';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface FadeProps {
|
|
6
|
+
in?: boolean;
|
|
7
|
+
duration?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
onEntered?: () => void;
|
|
12
|
+
onExited?: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const Fade: React.NamedExoticComponent<FadeProps>;
|
|
16
|
+
|
|
17
|
+
interface ScaleProps {
|
|
18
|
+
in?: boolean;
|
|
19
|
+
from?: number;
|
|
20
|
+
to?: number;
|
|
21
|
+
duration?: number;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const Scale: React.NamedExoticComponent<ScaleProps>;
|
|
27
|
+
|
|
28
|
+
type SlideDirection = 'up' | 'down' | 'left' | 'right';
|
|
29
|
+
interface SlideProps {
|
|
30
|
+
in?: boolean;
|
|
31
|
+
direction?: SlideDirection;
|
|
32
|
+
distance?: number;
|
|
33
|
+
duration?: number;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const Slide: React.NamedExoticComponent<SlideProps>;
|
|
39
|
+
|
|
40
|
+
interface BlurTransitionProps {
|
|
41
|
+
in?: boolean;
|
|
42
|
+
blurAmount?: number;
|
|
43
|
+
duration?: number;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
style?: StyleProp<ViewStyle>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare const BlurTransition: React.NamedExoticComponent<BlurTransitionProps>;
|
|
49
|
+
|
|
50
|
+
interface MagneticPressableProps {
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
strength?: number;
|
|
53
|
+
onPress?: () => void;
|
|
54
|
+
style?: StyleProp<ViewStyle>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const MagneticPressable: React.NamedExoticComponent<MagneticPressableProps>;
|
|
58
|
+
|
|
59
|
+
export { BlurTransition, type BlurTransitionProps, Fade, type FadeProps, MagneticPressable, type MagneticPressableProps, Scale, type ScaleProps, Slide, type SlideDirection, type SlideProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export * from 'reactnatively-animations';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface FadeProps {
|
|
6
|
+
in?: boolean;
|
|
7
|
+
duration?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
onEntered?: () => void;
|
|
12
|
+
onExited?: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const Fade: React.NamedExoticComponent<FadeProps>;
|
|
16
|
+
|
|
17
|
+
interface ScaleProps {
|
|
18
|
+
in?: boolean;
|
|
19
|
+
from?: number;
|
|
20
|
+
to?: number;
|
|
21
|
+
duration?: number;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const Scale: React.NamedExoticComponent<ScaleProps>;
|
|
27
|
+
|
|
28
|
+
type SlideDirection = 'up' | 'down' | 'left' | 'right';
|
|
29
|
+
interface SlideProps {
|
|
30
|
+
in?: boolean;
|
|
31
|
+
direction?: SlideDirection;
|
|
32
|
+
distance?: number;
|
|
33
|
+
duration?: number;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const Slide: React.NamedExoticComponent<SlideProps>;
|
|
39
|
+
|
|
40
|
+
interface BlurTransitionProps {
|
|
41
|
+
in?: boolean;
|
|
42
|
+
blurAmount?: number;
|
|
43
|
+
duration?: number;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
style?: StyleProp<ViewStyle>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare const BlurTransition: React.NamedExoticComponent<BlurTransitionProps>;
|
|
49
|
+
|
|
50
|
+
interface MagneticPressableProps {
|
|
51
|
+
children: ReactNode;
|
|
52
|
+
strength?: number;
|
|
53
|
+
onPress?: () => void;
|
|
54
|
+
style?: StyleProp<ViewStyle>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare const MagneticPressable: React.NamedExoticComponent<MagneticPressableProps>;
|
|
58
|
+
|
|
59
|
+
export { BlurTransition, type BlurTransitionProps, Fade, type FadeProps, MagneticPressable, type MagneticPressableProps, Scale, type ScaleProps, Slide, type SlideDirection, type SlideProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkN2PBBXCI_js = require('./chunk-N2PBBXCI.js');
|
|
4
|
+
require('./chunk-DGUM43GV.js');
|
|
5
|
+
var reactnativelyAnimations = require('reactnatively-animations');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "BlurTransition", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkN2PBBXCI_js.BlurTransition; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "Fade", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkN2PBBXCI_js.Fade; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "MagneticPressable", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkN2PBBXCI_js.MagneticPressable; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "Scale", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkN2PBBXCI_js.Scale; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "Slide", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkN2PBBXCI_js.Slide; }
|
|
28
|
+
});
|
|
29
|
+
Object.keys(reactnativelyAnimations).forEach(function (k) {
|
|
30
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return reactnativelyAnimations[k]; }
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=animations.js.map
|
|
36
|
+
//# sourceMappingURL=animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"animations.js","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"animations.mjs","sourcesContent":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { __require };
|
|
9
|
+
//# sourceMappingURL=chunk-BJTO5JO5.mjs.map
|
|
10
|
+
//# sourceMappingURL=chunk-BJTO5JO5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-BJTO5JO5.mjs"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
exports.__require = __require;
|
|
11
|
+
//# sourceMappingURL=chunk-DGUM43GV.js.map
|
|
12
|
+
//# sourceMappingURL=chunk-DGUM43GV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DGUM43GV.js"}
|