@xaui/native 0.9.1-alpha.2 → 0.9.1-alpha.3

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.cjs CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkB755PRVJcjs = require('./chunk-B755PRVJ.cjs');
9
8
 
10
9
 
11
10
 
@@ -17,25 +16,26 @@ var _chunkB755PRVJcjs = require('./chunk-B755PRVJ.cjs');
17
16
 
18
17
 
19
18
 
19
+ var _chunkV63JO65Fcjs = require('./chunk-V63JO65F.cjs');
20
20
 
21
21
 
22
22
 
23
23
 
24
- var _chunkNHPQQQ7Pcjs = require('./chunk-NHPQQQ7P.cjs');
25
24
 
26
25
 
27
- var _chunkM7P46XKIcjs = require('./chunk-M7P46XKI.cjs');
28
26
 
29
27
 
30
28
 
31
29
 
32
30
 
31
+ var _chunkAW63PTQ4cjs = require('./chunk-AW63PTQ4.cjs');
33
32
 
34
33
 
35
34
 
36
35
 
37
36
 
38
37
 
38
+ var _chunk3QBT3Q65cjs = require('./chunk-3QBT3Q65.cjs');
39
39
 
40
40
 
41
41
 
@@ -47,4 +47,26 @@ var _chunkM7P46XKIcjs = require('./chunk-M7P46XKI.cjs');
47
47
 
48
48
 
49
49
 
50
- exports.Slot = _chunkB755PRVJcjs.Slot; exports.ThemeContext = _chunkNHPQQQ7Pcjs.ThemeContext; exports.XAUIProvider = _chunkNHPQQQ7Pcjs.XAUIProvider; exports.buildRadius = _chunkNHPQQQ7Pcjs.buildRadius; exports.buildShadows = _chunkNHPQQQ7Pcjs.buildShadows; exports.childrenToString = _chunkB755PRVJcjs.childrenToString; exports.createRecipe = _chunkB755PRVJcjs.createRecipe; exports.createSlotContext = _chunkB755PRVJcjs.createSlotContext; exports.createTheme = _chunkNHPQQQ7Pcjs.createTheme; exports.defaultTheme = _chunkNHPQQQ7Pcjs.defaultTheme; exports.deriveColors = _chunkNHPQQQ7Pcjs.deriveColors; exports.deriveTint = _chunkM7P46XKIcjs.deriveTint; exports.mergeProps = _chunkB755PRVJcjs.mergeProps; exports.mergeRefs = _chunkB755PRVJcjs.mergeRefs; exports.palette = _chunkNHPQQQ7Pcjs.palette; exports.primitives = _chunkNHPQQQ7Pcjs.primitives; exports.sourceKeys = _chunkNHPQQQ7Pcjs.sourceKeys; exports.tokens = _chunkNHPQQQ7Pcjs.tokens; exports.useColorMode = _chunkNHPQQQ7Pcjs.useColorMode; exports.useThemeColor = _chunkNHPQQQ7Pcjs.useThemeColor; exports.useXAUITheme = _chunkNHPQQQ7Pcjs.useXAUITheme;
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+ exports.HIGHLIGHT_OPACITY = _chunkV63JO65Fcjs.HIGHLIGHT_OPACITY; exports.PRESS_DURATION = _chunkV63JO65Fcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunkV63JO65Fcjs.PRESS_SCALE; exports.PressableFeedback = _chunkV63JO65Fcjs.PressableFeedback; exports.RELEASE_DURATION = _chunkV63JO65Fcjs.RELEASE_DURATION; exports.RIPPLE_COVERAGE = _chunkV63JO65Fcjs.RIPPLE_COVERAGE; exports.RIPPLE_DURATION = _chunkV63JO65Fcjs.RIPPLE_DURATION; exports.RIPPLE_OPACITY = _chunkV63JO65Fcjs.RIPPLE_OPACITY; exports.Slot = _chunkV63JO65Fcjs.Slot; exports.ThemeContext = _chunk3QBT3Q65cjs.ThemeContext; exports.XAUIProvider = _chunkAW63PTQ4cjs.XAUIProvider; exports.buildRadius = _chunkAW63PTQ4cjs.buildRadius; exports.buildShadows = _chunkAW63PTQ4cjs.buildShadows; exports.childrenToString = _chunkV63JO65Fcjs.childrenToString; exports.createRecipe = _chunkV63JO65Fcjs.createRecipe; exports.createSlotContext = _chunkV63JO65Fcjs.createSlotContext; exports.createTheme = _chunkAW63PTQ4cjs.createTheme; exports.defaultTheme = _chunkAW63PTQ4cjs.defaultTheme; exports.deriveColors = _chunkAW63PTQ4cjs.deriveColors; exports.deriveTint = _chunk3QBT3Q65cjs.deriveTint; exports.mergeProps = _chunkV63JO65Fcjs.mergeProps; exports.mergeRefs = _chunkV63JO65Fcjs.mergeRefs; exports.palette = _chunkAW63PTQ4cjs.palette; exports.primitives = _chunkAW63PTQ4cjs.primitives; exports.resolveAnimation = _chunkV63JO65Fcjs.resolveAnimation; exports.resolveSlotAnimation = _chunkV63JO65Fcjs.resolveSlotAnimation; exports.sourceKeys = _chunkAW63PTQ4cjs.sourceKeys; exports.tokens = _chunkAW63PTQ4cjs.tokens; exports.useColorMode = _chunk3QBT3Q65cjs.useColorMode; exports.useFeedback = _chunkV63JO65Fcjs.useFeedback; exports.useThemeColor = _chunk3QBT3Q65cjs.useThemeColor; exports.useXAUITheme = _chunk3QBT3Q65cjs.useXAUITheme;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- export { AsChildProps, Axes, CompoundVariant, MergeableProps, PossibleRef, Recipe, RecipeConfig, ResolveArgs, ResolvedSelection, ResolvedStyles, Selection, Slot, SlotProps, SlotStyle, SlotStyles, StateName, States, StyleFn, TintArgs, VariantColors, VariantRole, VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs } from './system/index.cjs';
1
+ export { AnimationConfig, AnimationProp, AsChildProps, Axes, CompoundVariant, FeedbackContext, FeedbackVariant, HIGHLIGHT_OPACITY, MergeableProps, PRESS_DURATION, PRESS_SCALE, PossibleRef, PressableFeedback, PressableFeedbackHighlightProps, PressableFeedbackProps, PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, Recipe, RecipeConfig, ResolveArgs, ResolvedAnimation, ResolvedSelection, ResolvedStyles, Selection, Slot, SlotAnimation, SlotProps, SlotStyle, SlotStyles, StateName, States, StyleFn, TintArgs, VariantColors, VariantRole, VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback } from './system/index.cjs';
2
2
  export { ColorModePreference, PaletteFamily, PaletteShade, ThemeContext, XAUIProvider, XAUIProviderProps, XAUITint, buildRadius, buildShadows, createTheme, defaultTheme, deriveColors, deriveTint, palette, primitives, sourceKeys, tokens, useColorMode, useThemeColor, useXAUITheme } from './theme/index.cjs';
3
- export { C as ColorMode, F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, X as XAUIColors, b as XAUIDerivedColors, c as XAUIPrimitiveColors, d as XAUIRadius, e as XAUIShadow, f as XAUISourceColors, g as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-B3ODSLbB.cjs';
4
- import 'react-native';
3
+ export { C as ColorMode, F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, X as XAUIColors, b as XAUIDerivedColors, c as XAUIPrimitiveColors, d as XAUIRadius, e as XAUIShadow, f as XAUISourceColors, g as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-C9bFJKFm.cjs';
5
4
  import 'react';
5
+ import 'react-native';
6
+ import 'react-native-reanimated';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { AsChildProps, Axes, CompoundVariant, MergeableProps, PossibleRef, Recipe, RecipeConfig, ResolveArgs, ResolvedSelection, ResolvedStyles, Selection, Slot, SlotProps, SlotStyle, SlotStyles, StateName, States, StyleFn, TintArgs, VariantColors, VariantRole, VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs } from './system/index.js';
1
+ export { AnimationConfig, AnimationProp, AsChildProps, Axes, CompoundVariant, FeedbackContext, FeedbackVariant, HIGHLIGHT_OPACITY, MergeableProps, PRESS_DURATION, PRESS_SCALE, PossibleRef, PressableFeedback, PressableFeedbackHighlightProps, PressableFeedbackProps, PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, Recipe, RecipeConfig, ResolveArgs, ResolvedAnimation, ResolvedSelection, ResolvedStyles, Selection, Slot, SlotAnimation, SlotProps, SlotStyle, SlotStyles, StateName, States, StyleFn, TintArgs, VariantColors, VariantRole, VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback } from './system/index.js';
2
2
  export { ColorModePreference, PaletteFamily, PaletteShade, ThemeContext, XAUIProvider, XAUIProviderProps, XAUITint, buildRadius, buildShadows, createTheme, defaultTheme, deriveColors, deriveTint, palette, primitives, sourceKeys, tokens, useColorMode, useThemeColor, useXAUITheme } from './theme/index.js';
3
- export { C as ColorMode, F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, X as XAUIColors, b as XAUIDerivedColors, c as XAUIPrimitiveColors, d as XAUIRadius, e as XAUIShadow, f as XAUISourceColors, g as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-B3ODSLbB.js';
4
- import 'react-native';
3
+ export { C as ColorMode, F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, X as XAUIColors, b as XAUIDerivedColors, c as XAUIPrimitiveColors, d as XAUIRadius, e as XAUIShadow, f as XAUISourceColors, g as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-C9bFJKFm.js';
5
4
  import 'react';
5
+ import 'react-native';
6
+ import 'react-native-reanimated';
package/dist/index.js CHANGED
@@ -1,13 +1,23 @@
1
1
  import {
2
+ HIGHLIGHT_OPACITY,
3
+ PRESS_DURATION,
4
+ PRESS_SCALE,
5
+ PressableFeedback,
6
+ RELEASE_DURATION,
7
+ RIPPLE_COVERAGE,
8
+ RIPPLE_DURATION,
9
+ RIPPLE_OPACITY,
2
10
  Slot,
3
11
  childrenToString,
4
12
  createRecipe,
5
13
  createSlotContext,
6
14
  mergeProps,
7
- mergeRefs
8
- } from "./chunk-RCP3SD26.js";
15
+ mergeRefs,
16
+ resolveAnimation,
17
+ resolveSlotAnimation,
18
+ useFeedback
19
+ } from "./chunk-QAMNNTGM.js";
9
20
  import {
10
- ThemeContext,
11
21
  XAUIProvider,
12
22
  buildRadius,
13
23
  buildShadows,
@@ -17,15 +27,24 @@ import {
17
27
  palette,
18
28
  primitives,
19
29
  sourceKeys,
20
- tokens,
30
+ tokens
31
+ } from "./chunk-2KXQATVL.js";
32
+ import {
33
+ ThemeContext,
34
+ deriveTint,
21
35
  useColorMode,
22
36
  useThemeColor,
23
37
  useXAUITheme
24
- } from "./chunk-PBVPOX7D.js";
25
- import {
26
- deriveTint
27
- } from "./chunk-RBNCR5KB.js";
38
+ } from "./chunk-X2K2FX3W.js";
28
39
  export {
40
+ HIGHLIGHT_OPACITY,
41
+ PRESS_DURATION,
42
+ PRESS_SCALE,
43
+ PressableFeedback,
44
+ RELEASE_DURATION,
45
+ RIPPLE_COVERAGE,
46
+ RIPPLE_DURATION,
47
+ RIPPLE_OPACITY,
29
48
  Slot,
30
49
  ThemeContext,
31
50
  XAUIProvider,
@@ -42,9 +61,12 @@ export {
42
61
  mergeRefs,
43
62
  palette,
44
63
  primitives,
64
+ resolveAnimation,
65
+ resolveSlotAnimation,
45
66
  sourceKeys,
46
67
  tokens,
47
68
  useColorMode,
69
+ useFeedback,
48
70
  useThemeColor,
49
71
  useXAUITheme
50
72
  };
@@ -5,8 +5,6 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkB755PRVJcjs = require('../chunk-B755PRVJ.cjs');
9
- require('../chunk-M7P46XKI.cjs');
10
8
 
11
9
 
12
10
 
@@ -14,4 +12,28 @@ require('../chunk-M7P46XKI.cjs');
14
12
 
15
13
 
16
14
 
17
- exports.Slot = _chunkB755PRVJcjs.Slot; exports.childrenToString = _chunkB755PRVJcjs.childrenToString; exports.createRecipe = _chunkB755PRVJcjs.createRecipe; exports.createSlotContext = _chunkB755PRVJcjs.createSlotContext; exports.mergeProps = _chunkB755PRVJcjs.mergeProps; exports.mergeRefs = _chunkB755PRVJcjs.mergeRefs;
15
+
16
+
17
+
18
+
19
+ var _chunkV63JO65Fcjs = require('../chunk-V63JO65F.cjs');
20
+ require('../chunk-3QBT3Q65.cjs');
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ exports.HIGHLIGHT_OPACITY = _chunkV63JO65Fcjs.HIGHLIGHT_OPACITY; exports.PRESS_DURATION = _chunkV63JO65Fcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunkV63JO65Fcjs.PRESS_SCALE; exports.PressableFeedback = _chunkV63JO65Fcjs.PressableFeedback; exports.RELEASE_DURATION = _chunkV63JO65Fcjs.RELEASE_DURATION; exports.RIPPLE_COVERAGE = _chunkV63JO65Fcjs.RIPPLE_COVERAGE; exports.RIPPLE_DURATION = _chunkV63JO65Fcjs.RIPPLE_DURATION; exports.RIPPLE_OPACITY = _chunkV63JO65Fcjs.RIPPLE_OPACITY; exports.Slot = _chunkV63JO65Fcjs.Slot; exports.childrenToString = _chunkV63JO65Fcjs.childrenToString; exports.createRecipe = _chunkV63JO65Fcjs.createRecipe; exports.createSlotContext = _chunkV63JO65Fcjs.createSlotContext; exports.mergeProps = _chunkV63JO65Fcjs.mergeProps; exports.mergeRefs = _chunkV63JO65Fcjs.mergeRefs; exports.resolveAnimation = _chunkV63JO65Fcjs.resolveAnimation; exports.resolveSlotAnimation = _chunkV63JO65Fcjs.resolveSlotAnimation; exports.useFeedback = _chunkV63JO65Fcjs.useFeedback;
@@ -1,7 +1,186 @@
1
- import { g as XAUITheme, X as XAUIColors } from '../theme.type-B3ODSLbB.cjs';
2
- import { ViewStyle, TextStyle } from 'react-native';
3
1
  import * as react from 'react';
4
2
  import { ReactNode, Provider, Ref, RefCallback } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { PressableProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
5
+ import { SharedValue } from 'react-native-reanimated';
6
+ import { g as XAUITheme, X as XAUIColors } from '../theme.type-C9bFJKFm.cjs';
7
+
8
+ /**
9
+ * What the root does under the finger. `scale-highlight` and `scale-ripple` mount their
10
+ * overlay themselves; `scale` mounts none, which is what a root picks when it renders its
11
+ * own `<PressableFeedback.Highlight>` to style it (R1: no prop reaches into another
12
+ * component's insides).
13
+ */
14
+ type FeedbackVariant = 'scale-highlight' | 'scale-ripple' | 'scale' | 'none';
15
+ type AnimationConfig = {
16
+ scale?: boolean;
17
+ highlight?: boolean;
18
+ ripple?: boolean;
19
+ };
20
+ /**
21
+ * `false` and `'disabled'` turn this component's animations off. `'disable-all'` turns
22
+ * them off for its descendants too — a long list kills every row's worklets with one
23
+ * prop instead of threading it down. An object switches them off one at a time.
24
+ */
25
+ type AnimationProp = boolean | 'disabled' | 'disable-all' | AnimationConfig;
26
+ /** `animation` once normalised — what the components actually read. */
27
+ type ResolvedAnimation = {
28
+ scale: boolean;
29
+ highlight: boolean;
30
+ ripple: boolean;
31
+ /** True when every sub-animation is off: the branch that mounts no worklet at all. */
32
+ none: boolean;
33
+ /** Propagated to descendants through context. */
34
+ disableAll: boolean;
35
+ };
36
+ type PressableFeedbackProps = Omit<PressableProps, 'style' | 'children' | 'disabled'> & {
37
+ /** Controlled: the root owns the state, because its recipe resolves on it (R5). */
38
+ isPressed?: boolean;
39
+ /** R8: `disabled` is not part of the public vocabulary, `isX` is. */
40
+ isDisabled?: boolean;
41
+ /**
42
+ * Merge into the single child instead of rendering a pressable (R12) — **keeping the
43
+ * feedback**. Swapping this component out for a bare `Slot` would silently drop the
44
+ * touch feedback of every `asChild` control.
45
+ */
46
+ asChild?: boolean;
47
+ feedbackVariant?: FeedbackVariant;
48
+ animation?: AnimationProp;
49
+ style?: StyleProp<ViewStyle>;
50
+ /**
51
+ * `Pressable`'s function form is dropped on purpose. It exists to hand the press state
52
+ * to children; here the root above already owns that state and this publishes it
53
+ * through context, so the function form would be a second, quieter source of truth.
54
+ */
55
+ children?: ReactNode;
56
+ };
57
+ /**
58
+ * A slot's own animation, overriding the blanket one on the root. `false` switches that
59
+ * slot off; the object tunes it. Deliberately two knobs rather than a full timing
60
+ * surface — anything past this is a different animation, and that is a component's job,
61
+ * not a prop's.
62
+ */
63
+ type SlotAnimation = boolean | {
64
+ /** Milliseconds. Falls back to the shared press timing. */
65
+ duration?: number;
66
+ /** How far the overlay goes at full press, 0 to 1. */
67
+ opacity?: number;
68
+ };
69
+ type FeedbackContext = {
70
+ isPressed: boolean;
71
+ animation: ResolvedAnimation;
72
+ /** Absent on the static branch, where nothing animates and no worklet is mounted. */
73
+ progress?: SharedValue<number>;
74
+ /**
75
+ * Bumped on every press-in. The ripple starts from this rather than from a `useEffect`
76
+ * on `isPressed`: a one-shot driven by a boolean depends on React re-rendering between
77
+ * the two touch events, and starting it from the event that carries the coordinates is
78
+ * both simpler and impossible to miss.
79
+ */
80
+ pressCount?: SharedValue<number>;
81
+ /** Where the finger landed, and how big the root is — the ripple needs both. */
82
+ origin?: SharedValue<{
83
+ x: number;
84
+ y: number;
85
+ }>;
86
+ size?: SharedValue<{
87
+ width: number;
88
+ height: number;
89
+ }>;
90
+ };
91
+
92
+ type PressableFeedbackHighlightProps = {
93
+ style?: StyleProp<ViewStyle>;
94
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
95
+ animation?: SlotAnimation;
96
+ };
97
+ /**
98
+ * The press wash: one flat overlay fading in under the finger.
99
+ *
100
+ * It is a **neutral** wash, not the variant's pressed colour. A component picks one or
101
+ * the other — this overlay, or a `pressed` state in its recipe swapping `bg` for
102
+ * `bgPressed` — never both, or a pressed button darkens twice.
103
+ */
104
+ declare function PressableFeedbackHighlight({ style, animation: override, }: PressableFeedbackHighlightProps): react.JSX.Element;
105
+ declare namespace PressableFeedbackHighlight {
106
+ var displayName: string;
107
+ }
108
+
109
+ type PressableFeedbackRippleProps = {
110
+ style?: StyleProp<ViewStyle>;
111
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
112
+ animation?: SlotAnimation;
113
+ };
114
+ /**
115
+ * A circle washing outwards from where the finger landed.
116
+ *
117
+ * It is a **one-shot, independent of how long the press lasts**: the wave runs its course
118
+ * and ends, the way a ripple in water does. Tying it to the press would leave a disc
119
+ * parked on the control for as long as a finger rests there.
120
+ *
121
+ * It needs the root to clip — `PressableFeedback` sets `overflow: 'hidden'` when it
122
+ * mounts one — and it renders nothing on the static branch: a ripple that cannot expand
123
+ * is a coloured disc sitting on the control, which reads as a defect rather than as
124
+ * reduced motion.
125
+ */
126
+ declare function PressableFeedbackRipple({ style, animation: override, }: PressableFeedbackRippleProps): react.JSX.Element | null;
127
+ declare namespace PressableFeedbackRipple {
128
+ var displayName: string;
129
+ }
130
+
131
+ declare const useFeedback: () => FeedbackContext;
132
+
133
+ /**
134
+ * The values the v0 tree shipped with (`Animated.spring` to `0.975`, `bounciness: 0`,
135
+ * over roughly 100ms). Kept identical on purpose: the touch feedback is the part of a
136
+ * library users feel rather than read, and changing its timing in a rewrite would be a
137
+ * regression nobody asked for. `bounciness: 0` is why a duration replaces the spring —
138
+ * a spring with no bounce is a curve.
139
+ */
140
+ declare const PRESS_SCALE = 0.975;
141
+ declare const PRESS_DURATION = 100;
142
+ declare const RELEASE_DURATION = 150;
143
+ /** How far the wash and the ripple go at full press. */
144
+ declare const HIGHLIGHT_OPACITY = 0.08;
145
+ declare const RIPPLE_OPACITY = 0.12;
146
+ declare const RIPPLE_DURATION = 350;
147
+ /**
148
+ * The circle's radius as a multiple of the control's diagonal. Above 1 it covers from
149
+ * any point on the control, so where the finger landed never enters the calculation.
150
+ */
151
+ declare const RIPPLE_COVERAGE = 1.25;
152
+ /**
153
+ * One shape out of four accepted ones, so the components read a record instead of
154
+ * re-deciding what `'disable-all'` meant.
155
+ *
156
+ * `inheritedDisableAll` comes from an ancestor that asked for it, and it wins: a list
157
+ * that switched its rows' animations off cannot be overridden by a row.
158
+ */
159
+ declare function resolveAnimation(animation: AnimationProp | undefined, inheritedDisableAll?: boolean): ResolvedAnimation;
160
+ type ResolvedSlotAnimation = {
161
+ enabled: boolean;
162
+ duration: number;
163
+ opacity: number;
164
+ };
165
+ /**
166
+ * A slot's own `animation` over the root's blanket one, with the root winning when it
167
+ * switched everything off — `animation="disable-all"` on an ancestor cannot be undone by
168
+ * an overlay that asks nicely.
169
+ */
170
+ declare function resolveSlotAnimation(override: SlotAnimation | undefined, enabledByRoot: boolean, defaultOpacity: number, defaultDuration?: number): ResolvedSlotAnimation;
171
+
172
+ declare const PressableFeedback: react.ForwardRefExoticComponent<Omit<react_native.PressableProps, "disabled" | "style" | "children"> & {
173
+ isPressed?: boolean;
174
+ isDisabled?: boolean;
175
+ asChild?: boolean;
176
+ feedbackVariant?: FeedbackVariant;
177
+ animation?: AnimationProp;
178
+ style?: react_native.StyleProp<react_native.ViewStyle>;
179
+ children?: react.ReactNode;
180
+ } & react.RefAttributes<react_native.View>> & {
181
+ Highlight: typeof PressableFeedbackHighlight;
182
+ Ripple: typeof PressableFeedbackRipple;
183
+ };
5
184
 
6
185
  /**
7
186
  * A slot is a view or a text node, and a recipe writes one object per slot, so the two
@@ -171,4 +350,4 @@ type SlotProps = MergeableProps & {
171
350
  */
172
351
  declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
173
352
 
174
- export { type AsChildProps, type Axes, type CompoundVariant, type MergeableProps, type PossibleRef, type Recipe, type RecipeConfig, type ResolveArgs, type ResolvedSelection, type ResolvedStyles, type Selection, Slot, type SlotProps, type SlotStyle, type SlotStyles, type StateName, type States, type StyleFn, type TintArgs, type VariantColors, type VariantRole, type VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs };
353
+ export { type AnimationConfig, type AnimationProp, type AsChildProps, type Axes, type CompoundVariant, type FeedbackContext, type FeedbackVariant, HIGHLIGHT_OPACITY, type MergeableProps, PRESS_DURATION, PRESS_SCALE, type PossibleRef, PressableFeedback, type PressableFeedbackHighlightProps, type PressableFeedbackProps, type PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, type Recipe, type RecipeConfig, type ResolveArgs, type ResolvedAnimation, type ResolvedSelection, type ResolvedStyles, type Selection, Slot, type SlotAnimation, type SlotProps, type SlotStyle, type SlotStyles, type StateName, type States, type StyleFn, type TintArgs, type VariantColors, type VariantRole, type VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback };
@@ -1,7 +1,186 @@
1
- import { g as XAUITheme, X as XAUIColors } from '../theme.type-B3ODSLbB.js';
2
- import { ViewStyle, TextStyle } from 'react-native';
3
1
  import * as react from 'react';
4
2
  import { ReactNode, Provider, Ref, RefCallback } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { PressableProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
5
+ import { SharedValue } from 'react-native-reanimated';
6
+ import { g as XAUITheme, X as XAUIColors } from '../theme.type-C9bFJKFm.js';
7
+
8
+ /**
9
+ * What the root does under the finger. `scale-highlight` and `scale-ripple` mount their
10
+ * overlay themselves; `scale` mounts none, which is what a root picks when it renders its
11
+ * own `<PressableFeedback.Highlight>` to style it (R1: no prop reaches into another
12
+ * component's insides).
13
+ */
14
+ type FeedbackVariant = 'scale-highlight' | 'scale-ripple' | 'scale' | 'none';
15
+ type AnimationConfig = {
16
+ scale?: boolean;
17
+ highlight?: boolean;
18
+ ripple?: boolean;
19
+ };
20
+ /**
21
+ * `false` and `'disabled'` turn this component's animations off. `'disable-all'` turns
22
+ * them off for its descendants too — a long list kills every row's worklets with one
23
+ * prop instead of threading it down. An object switches them off one at a time.
24
+ */
25
+ type AnimationProp = boolean | 'disabled' | 'disable-all' | AnimationConfig;
26
+ /** `animation` once normalised — what the components actually read. */
27
+ type ResolvedAnimation = {
28
+ scale: boolean;
29
+ highlight: boolean;
30
+ ripple: boolean;
31
+ /** True when every sub-animation is off: the branch that mounts no worklet at all. */
32
+ none: boolean;
33
+ /** Propagated to descendants through context. */
34
+ disableAll: boolean;
35
+ };
36
+ type PressableFeedbackProps = Omit<PressableProps, 'style' | 'children' | 'disabled'> & {
37
+ /** Controlled: the root owns the state, because its recipe resolves on it (R5). */
38
+ isPressed?: boolean;
39
+ /** R8: `disabled` is not part of the public vocabulary, `isX` is. */
40
+ isDisabled?: boolean;
41
+ /**
42
+ * Merge into the single child instead of rendering a pressable (R12) — **keeping the
43
+ * feedback**. Swapping this component out for a bare `Slot` would silently drop the
44
+ * touch feedback of every `asChild` control.
45
+ */
46
+ asChild?: boolean;
47
+ feedbackVariant?: FeedbackVariant;
48
+ animation?: AnimationProp;
49
+ style?: StyleProp<ViewStyle>;
50
+ /**
51
+ * `Pressable`'s function form is dropped on purpose. It exists to hand the press state
52
+ * to children; here the root above already owns that state and this publishes it
53
+ * through context, so the function form would be a second, quieter source of truth.
54
+ */
55
+ children?: ReactNode;
56
+ };
57
+ /**
58
+ * A slot's own animation, overriding the blanket one on the root. `false` switches that
59
+ * slot off; the object tunes it. Deliberately two knobs rather than a full timing
60
+ * surface — anything past this is a different animation, and that is a component's job,
61
+ * not a prop's.
62
+ */
63
+ type SlotAnimation = boolean | {
64
+ /** Milliseconds. Falls back to the shared press timing. */
65
+ duration?: number;
66
+ /** How far the overlay goes at full press, 0 to 1. */
67
+ opacity?: number;
68
+ };
69
+ type FeedbackContext = {
70
+ isPressed: boolean;
71
+ animation: ResolvedAnimation;
72
+ /** Absent on the static branch, where nothing animates and no worklet is mounted. */
73
+ progress?: SharedValue<number>;
74
+ /**
75
+ * Bumped on every press-in. The ripple starts from this rather than from a `useEffect`
76
+ * on `isPressed`: a one-shot driven by a boolean depends on React re-rendering between
77
+ * the two touch events, and starting it from the event that carries the coordinates is
78
+ * both simpler and impossible to miss.
79
+ */
80
+ pressCount?: SharedValue<number>;
81
+ /** Where the finger landed, and how big the root is — the ripple needs both. */
82
+ origin?: SharedValue<{
83
+ x: number;
84
+ y: number;
85
+ }>;
86
+ size?: SharedValue<{
87
+ width: number;
88
+ height: number;
89
+ }>;
90
+ };
91
+
92
+ type PressableFeedbackHighlightProps = {
93
+ style?: StyleProp<ViewStyle>;
94
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
95
+ animation?: SlotAnimation;
96
+ };
97
+ /**
98
+ * The press wash: one flat overlay fading in under the finger.
99
+ *
100
+ * It is a **neutral** wash, not the variant's pressed colour. A component picks one or
101
+ * the other — this overlay, or a `pressed` state in its recipe swapping `bg` for
102
+ * `bgPressed` — never both, or a pressed button darkens twice.
103
+ */
104
+ declare function PressableFeedbackHighlight({ style, animation: override, }: PressableFeedbackHighlightProps): react.JSX.Element;
105
+ declare namespace PressableFeedbackHighlight {
106
+ var displayName: string;
107
+ }
108
+
109
+ type PressableFeedbackRippleProps = {
110
+ style?: StyleProp<ViewStyle>;
111
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
112
+ animation?: SlotAnimation;
113
+ };
114
+ /**
115
+ * A circle washing outwards from where the finger landed.
116
+ *
117
+ * It is a **one-shot, independent of how long the press lasts**: the wave runs its course
118
+ * and ends, the way a ripple in water does. Tying it to the press would leave a disc
119
+ * parked on the control for as long as a finger rests there.
120
+ *
121
+ * It needs the root to clip — `PressableFeedback` sets `overflow: 'hidden'` when it
122
+ * mounts one — and it renders nothing on the static branch: a ripple that cannot expand
123
+ * is a coloured disc sitting on the control, which reads as a defect rather than as
124
+ * reduced motion.
125
+ */
126
+ declare function PressableFeedbackRipple({ style, animation: override, }: PressableFeedbackRippleProps): react.JSX.Element | null;
127
+ declare namespace PressableFeedbackRipple {
128
+ var displayName: string;
129
+ }
130
+
131
+ declare const useFeedback: () => FeedbackContext;
132
+
133
+ /**
134
+ * The values the v0 tree shipped with (`Animated.spring` to `0.975`, `bounciness: 0`,
135
+ * over roughly 100ms). Kept identical on purpose: the touch feedback is the part of a
136
+ * library users feel rather than read, and changing its timing in a rewrite would be a
137
+ * regression nobody asked for. `bounciness: 0` is why a duration replaces the spring —
138
+ * a spring with no bounce is a curve.
139
+ */
140
+ declare const PRESS_SCALE = 0.975;
141
+ declare const PRESS_DURATION = 100;
142
+ declare const RELEASE_DURATION = 150;
143
+ /** How far the wash and the ripple go at full press. */
144
+ declare const HIGHLIGHT_OPACITY = 0.08;
145
+ declare const RIPPLE_OPACITY = 0.12;
146
+ declare const RIPPLE_DURATION = 350;
147
+ /**
148
+ * The circle's radius as a multiple of the control's diagonal. Above 1 it covers from
149
+ * any point on the control, so where the finger landed never enters the calculation.
150
+ */
151
+ declare const RIPPLE_COVERAGE = 1.25;
152
+ /**
153
+ * One shape out of four accepted ones, so the components read a record instead of
154
+ * re-deciding what `'disable-all'` meant.
155
+ *
156
+ * `inheritedDisableAll` comes from an ancestor that asked for it, and it wins: a list
157
+ * that switched its rows' animations off cannot be overridden by a row.
158
+ */
159
+ declare function resolveAnimation(animation: AnimationProp | undefined, inheritedDisableAll?: boolean): ResolvedAnimation;
160
+ type ResolvedSlotAnimation = {
161
+ enabled: boolean;
162
+ duration: number;
163
+ opacity: number;
164
+ };
165
+ /**
166
+ * A slot's own `animation` over the root's blanket one, with the root winning when it
167
+ * switched everything off — `animation="disable-all"` on an ancestor cannot be undone by
168
+ * an overlay that asks nicely.
169
+ */
170
+ declare function resolveSlotAnimation(override: SlotAnimation | undefined, enabledByRoot: boolean, defaultOpacity: number, defaultDuration?: number): ResolvedSlotAnimation;
171
+
172
+ declare const PressableFeedback: react.ForwardRefExoticComponent<Omit<react_native.PressableProps, "disabled" | "style" | "children"> & {
173
+ isPressed?: boolean;
174
+ isDisabled?: boolean;
175
+ asChild?: boolean;
176
+ feedbackVariant?: FeedbackVariant;
177
+ animation?: AnimationProp;
178
+ style?: react_native.StyleProp<react_native.ViewStyle>;
179
+ children?: react.ReactNode;
180
+ } & react.RefAttributes<react_native.View>> & {
181
+ Highlight: typeof PressableFeedbackHighlight;
182
+ Ripple: typeof PressableFeedbackRipple;
183
+ };
5
184
 
6
185
  /**
7
186
  * A slot is a view or a text node, and a recipe writes one object per slot, so the two
@@ -171,4 +350,4 @@ type SlotProps = MergeableProps & {
171
350
  */
172
351
  declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
173
352
 
174
- export { type AsChildProps, type Axes, type CompoundVariant, type MergeableProps, type PossibleRef, type Recipe, type RecipeConfig, type ResolveArgs, type ResolvedSelection, type ResolvedStyles, type Selection, Slot, type SlotProps, type SlotStyle, type SlotStyles, type StateName, type States, type StyleFn, type TintArgs, type VariantColors, type VariantRole, type VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs };
353
+ export { type AnimationConfig, type AnimationProp, type AsChildProps, type Axes, type CompoundVariant, type FeedbackContext, type FeedbackVariant, HIGHLIGHT_OPACITY, type MergeableProps, PRESS_DURATION, PRESS_SCALE, type PossibleRef, PressableFeedback, type PressableFeedbackHighlightProps, type PressableFeedbackProps, type PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, type Recipe, type RecipeConfig, type ResolveArgs, type ResolvedAnimation, type ResolvedSelection, type ResolvedStyles, type Selection, Slot, type SlotAnimation, type SlotProps, type SlotStyle, type SlotStyles, type StateName, type States, type StyleFn, type TintArgs, type VariantColors, type VariantRole, type VariantTokens, childrenToString, createRecipe, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback };
@@ -1,17 +1,39 @@
1
1
  import {
2
+ HIGHLIGHT_OPACITY,
3
+ PRESS_DURATION,
4
+ PRESS_SCALE,
5
+ PressableFeedback,
6
+ RELEASE_DURATION,
7
+ RIPPLE_COVERAGE,
8
+ RIPPLE_DURATION,
9
+ RIPPLE_OPACITY,
2
10
  Slot,
3
11
  childrenToString,
4
12
  createRecipe,
5
13
  createSlotContext,
6
14
  mergeProps,
7
- mergeRefs
8
- } from "../chunk-RCP3SD26.js";
9
- import "../chunk-RBNCR5KB.js";
15
+ mergeRefs,
16
+ resolveAnimation,
17
+ resolveSlotAnimation,
18
+ useFeedback
19
+ } from "../chunk-QAMNNTGM.js";
20
+ import "../chunk-X2K2FX3W.js";
10
21
  export {
22
+ HIGHLIGHT_OPACITY,
23
+ PRESS_DURATION,
24
+ PRESS_SCALE,
25
+ PressableFeedback,
26
+ RELEASE_DURATION,
27
+ RIPPLE_COVERAGE,
28
+ RIPPLE_DURATION,
29
+ RIPPLE_OPACITY,
11
30
  Slot,
12
31
  childrenToString,
13
32
  createRecipe,
14
33
  createSlotContext,
15
34
  mergeProps,
16
- mergeRefs
35
+ mergeRefs,
36
+ resolveAnimation,
37
+ resolveSlotAnimation,
38
+ useFeedback
17
39
  };
@@ -9,14 +9,14 @@
9
9
 
10
10
 
11
11
 
12
+ var _chunkAW63PTQ4cjs = require('../chunk-AW63PTQ4.cjs');
12
13
 
13
14
 
14
15
 
15
16
 
16
- var _chunkNHPQQQ7Pcjs = require('../chunk-NHPQQQ7P.cjs');
17
17
 
18
18
 
19
- var _chunkM7P46XKIcjs = require('../chunk-M7P46XKI.cjs');
19
+ var _chunk3QBT3Q65cjs = require('../chunk-3QBT3Q65.cjs');
20
20
 
21
21
 
22
22
 
@@ -33,4 +33,4 @@ var _chunkM7P46XKIcjs = require('../chunk-M7P46XKI.cjs');
33
33
 
34
34
 
35
35
 
36
- exports.ThemeContext = _chunkNHPQQQ7Pcjs.ThemeContext; exports.XAUIProvider = _chunkNHPQQQ7Pcjs.XAUIProvider; exports.buildRadius = _chunkNHPQQQ7Pcjs.buildRadius; exports.buildShadows = _chunkNHPQQQ7Pcjs.buildShadows; exports.createTheme = _chunkNHPQQQ7Pcjs.createTheme; exports.defaultTheme = _chunkNHPQQQ7Pcjs.defaultTheme; exports.deriveColors = _chunkNHPQQQ7Pcjs.deriveColors; exports.deriveTint = _chunkM7P46XKIcjs.deriveTint; exports.palette = _chunkNHPQQQ7Pcjs.palette; exports.primitives = _chunkNHPQQQ7Pcjs.primitives; exports.sourceKeys = _chunkNHPQQQ7Pcjs.sourceKeys; exports.tokens = _chunkNHPQQQ7Pcjs.tokens; exports.useColorMode = _chunkNHPQQQ7Pcjs.useColorMode; exports.useThemeColor = _chunkNHPQQQ7Pcjs.useThemeColor; exports.useXAUITheme = _chunkNHPQQQ7Pcjs.useXAUITheme;
36
+ exports.ThemeContext = _chunk3QBT3Q65cjs.ThemeContext; exports.XAUIProvider = _chunkAW63PTQ4cjs.XAUIProvider; exports.buildRadius = _chunkAW63PTQ4cjs.buildRadius; exports.buildShadows = _chunkAW63PTQ4cjs.buildShadows; exports.createTheme = _chunkAW63PTQ4cjs.createTheme; exports.defaultTheme = _chunkAW63PTQ4cjs.defaultTheme; exports.deriveColors = _chunkAW63PTQ4cjs.deriveColors; exports.deriveTint = _chunk3QBT3Q65cjs.deriveTint; exports.palette = _chunkAW63PTQ4cjs.palette; exports.primitives = _chunkAW63PTQ4cjs.primitives; exports.sourceKeys = _chunkAW63PTQ4cjs.sourceKeys; exports.tokens = _chunkAW63PTQ4cjs.tokens; exports.useColorMode = _chunk3QBT3Q65cjs.useColorMode; exports.useThemeColor = _chunk3QBT3Q65cjs.useThemeColor; exports.useXAUITheme = _chunk3QBT3Q65cjs.useXAUITheme;
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { i as XAUIThemeSet, h as XAUIThemeConfig, f as XAUISourceColors, b as XAUIDerivedColors, g as XAUITheme, d as XAUIRadius, C as ColorMode, X as XAUIColors } from '../theme.type-B3ODSLbB.cjs';
4
- export { F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, c as XAUIPrimitiveColors, e as XAUIShadow } from '../theme.type-B3ODSLbB.cjs';
3
+ import { i as XAUIThemeSet, h as XAUIThemeConfig, f as XAUISourceColors, b as XAUIDerivedColors, g as XAUITheme, d as XAUIRadius, C as ColorMode, X as XAUIColors } from '../theme.type-C9bFJKFm.cjs';
4
+ export { F as FontSizeKey, a as FontWeightKey, R as RadiusKey, S as Size, c as XAUIPrimitiveColors, e as XAUIShadow } from '../theme.type-C9bFJKFm.cjs';
5
+ import 'react-native';
5
6
 
6
7
  /** `'system'` follows the device; the resolved value is never `'system'`. */
7
8
  type ColorModePreference = 'light' | 'dark' | 'system';