@xaui/native 0.9.1-alpha.0 → 0.9.1-alpha.10

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.
@@ -0,0 +1,53 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkLMUPNKPHcjs = require('../chunk-LMUPNKPH.cjs');
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ var _chunk7D262JCJcjs = require('../chunk-7D262JCJ.cjs');
28
+ require('../chunk-3QBT3Q65.cjs');
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ exports.HIGHLIGHT_OPACITY = _chunk7D262JCJcjs.HIGHLIGHT_OPACITY; exports.Icon = _chunk7D262JCJcjs.Icon; exports.IconContext = _chunk7D262JCJcjs.IconContext; exports.PRESS_DURATION = _chunk7D262JCJcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunk7D262JCJcjs.PRESS_SCALE; exports.Portal = _chunkLMUPNKPHcjs.Portal; exports.PortalContext = _chunkLMUPNKPHcjs.PortalContext; exports.PortalHost = _chunkLMUPNKPHcjs.PortalHost; exports.PressableFeedback = _chunk7D262JCJcjs.PressableFeedback; exports.RELEASE_DURATION = _chunk7D262JCJcjs.RELEASE_DURATION; exports.RIPPLE_COVERAGE = _chunk7D262JCJcjs.RIPPLE_COVERAGE; exports.RIPPLE_DURATION = _chunk7D262JCJcjs.RIPPLE_DURATION; exports.RIPPLE_OPACITY = _chunk7D262JCJcjs.RIPPLE_OPACITY; exports.Slot = _chunk7D262JCJcjs.Slot; exports.childrenToString = _chunk7D262JCJcjs.childrenToString; exports.createRecipe = _chunk7D262JCJcjs.createRecipe; exports.createSlotContext = _chunk7D262JCJcjs.createSlotContext; exports.mergeProps = _chunk7D262JCJcjs.mergeProps; exports.mergeRefs = _chunk7D262JCJcjs.mergeRefs; exports.resolveAnimation = _chunk7D262JCJcjs.resolveAnimation; exports.resolveSlotAnimation = _chunk7D262JCJcjs.resolveSlotAnimation; exports.useFeedback = _chunk7D262JCJcjs.useFeedback; exports.useIconContext = _chunk7D262JCJcjs.useIconContext;
@@ -0,0 +1,262 @@
1
+ import * as react from 'react';
2
+ import { Ref, ReactNode, Provider, RefCallback } from 'react';
3
+ import { b as IconProps, a as IconContextValue, S as SlotAnimation, F as FeedbackContext, c as AnimationProp, R as ResolvedAnimation, d as FeedbackVariant } from '../create-recipe-BjSP0zL_.cjs';
4
+ export { A as AnimationConfig, h as Axes, C as CompoundVariant, I as IconComponentProps, P as PressableFeedbackProps, f as Recipe, i as RecipeConfig, g as ResolveArgs, j as ResolvedSelection, k as ResolvedStyles, l as Selection, m as SlotStyle, n as SlotStyles, o as StateName, p as States, q as StyleFn, T as TintArgs, V as VariantColors, r as VariantRole, s as VariantTokens, e as createRecipe } from '../create-recipe-BjSP0zL_.cjs';
5
+ import * as react_native from 'react-native';
6
+ import { StyleProp, ViewStyle } from 'react-native';
7
+ import 'react-native-reanimated';
8
+ import '../theme.type-C9bFJKFm.cjs';
9
+
10
+ /**
11
+ * The gap nobody else closes: an icon is a third-party component, so a slot context does
12
+ * not reach it and every call site ends up computing the colour by hand.
13
+ *
14
+ * ```tsx
15
+ * <Button variant="danger">
16
+ * <Button.Icon as={TrashIcon} /> {/* colour and size inherited, nothing to pass *\/}
17
+ * <Button.Label>Supprimer</Button.Label>
18
+ * </Button>
19
+ * ```
20
+ *
21
+ * Three accepted forms — a component through `as`, a raw SVG as children, or an image
22
+ * through `source` — and the resolution is the same for all three: an explicit prop, else
23
+ * what the surrounding slot published, else the theme.
24
+ */
25
+ declare function Icon({ as: Component, children, source, size, color, style, }: IconProps): react.JSX.Element;
26
+ declare namespace Icon {
27
+ var displayName: string;
28
+ }
29
+
30
+ /**
31
+ * Not a `createSlotContext`: that one throws outside its parent, and an `Icon` has to
32
+ * work on its own as much as inside a `Button`. An empty context is the honest default —
33
+ * nothing inherited, so the theme decides.
34
+ */
35
+ declare const IconContext: react.Context<IconContextValue>;
36
+ declare function useIconContext(): IconContextValue;
37
+
38
+ type PressableFeedbackHighlightProps = {
39
+ style?: StyleProp<ViewStyle>;
40
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
41
+ animation?: SlotAnimation;
42
+ };
43
+ /**
44
+ * The press wash: one flat overlay fading in under the finger.
45
+ *
46
+ * It is a **neutral** wash, not the variant's pressed colour. A component picks one or
47
+ * the other — this overlay, or a `pressed` state in its recipe swapping `bg` for
48
+ * `bgPressed` — never both, or a pressed button darkens twice.
49
+ */
50
+ declare function PressableFeedbackHighlight({ style, animation: override, }: PressableFeedbackHighlightProps): react.JSX.Element;
51
+ declare namespace PressableFeedbackHighlight {
52
+ var displayName: string;
53
+ }
54
+
55
+ type PressableFeedbackRippleProps = {
56
+ style?: StyleProp<ViewStyle>;
57
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
58
+ animation?: SlotAnimation;
59
+ };
60
+ /**
61
+ * A circle washing outwards from where the finger landed.
62
+ *
63
+ * It is a **one-shot, independent of how long the press lasts**: the wave runs its course
64
+ * and ends, the way a ripple in water does. Tying it to the press would leave a disc
65
+ * parked on the control for as long as a finger rests there.
66
+ *
67
+ * It needs the root to clip — `PressableFeedback` sets `overflow: 'hidden'` when it
68
+ * mounts one — and it renders nothing on the static branch: a ripple that cannot expand
69
+ * is a coloured disc sitting on the control, which reads as a defect rather than as
70
+ * reduced motion.
71
+ */
72
+ declare function PressableFeedbackRipple({ style, animation: override, }: PressableFeedbackRippleProps): react.JSX.Element | null;
73
+ declare namespace PressableFeedbackRipple {
74
+ var displayName: string;
75
+ }
76
+
77
+ declare const useFeedback: () => FeedbackContext;
78
+
79
+ /**
80
+ * The values the v0 tree shipped with (`Animated.spring` to `0.975`, `bounciness: 0`,
81
+ * over roughly 100ms). Kept identical on purpose: the touch feedback is the part of a
82
+ * library users feel rather than read, and changing its timing in a rewrite would be a
83
+ * regression nobody asked for. `bounciness: 0` is why a duration replaces the spring —
84
+ * a spring with no bounce is a curve.
85
+ */
86
+ declare const PRESS_SCALE = 0.975;
87
+ declare const PRESS_DURATION = 100;
88
+ declare const RELEASE_DURATION = 150;
89
+ /** How far the wash and the ripple go at full press. */
90
+ declare const HIGHLIGHT_OPACITY = 0.08;
91
+ declare const RIPPLE_OPACITY = 0.12;
92
+ declare const RIPPLE_DURATION = 350;
93
+ /**
94
+ * The circle's radius as a multiple of the control's diagonal. Above 1 it covers from
95
+ * any point on the control, so where the finger landed never enters the calculation.
96
+ */
97
+ declare const RIPPLE_COVERAGE = 1.25;
98
+ /**
99
+ * One shape out of four accepted ones, so the components read a record instead of
100
+ * re-deciding what `'disable-all'` meant.
101
+ *
102
+ * `inheritedDisableAll` comes from an ancestor that asked for it, and it wins: a list
103
+ * that switched its rows' animations off cannot be overridden by a row.
104
+ */
105
+ declare function resolveAnimation(animation: AnimationProp | undefined, inheritedDisableAll?: boolean): ResolvedAnimation;
106
+ type ResolvedSlotAnimation = {
107
+ enabled: boolean;
108
+ duration: number;
109
+ opacity: number;
110
+ };
111
+ /**
112
+ * A slot's own `animation` over the root's blanket one, with the root winning when it
113
+ * switched everything off — `animation="disable-all"` on an ancestor cannot be undone by
114
+ * an overlay that asks nicely.
115
+ */
116
+ declare function resolveSlotAnimation(override: SlotAnimation | undefined, enabledByRoot: boolean, defaultOpacity: number, defaultDuration?: number): ResolvedSlotAnimation;
117
+
118
+ declare const PressableFeedback: react.ForwardRefExoticComponent<Omit<react_native.PressableProps, "children" | "style" | "disabled"> & {
119
+ isPressed?: boolean;
120
+ isDisabled?: boolean;
121
+ asChild?: boolean;
122
+ feedbackVariant?: FeedbackVariant;
123
+ animation?: AnimationProp;
124
+ style?: react_native.StyleProp<react_native.ViewStyle>;
125
+ children?: react.ReactNode;
126
+ } & react.RefAttributes<react_native.View>> & {
127
+ Highlight: typeof PressableFeedbackHighlight;
128
+ Ripple: typeof PressableFeedbackRipple;
129
+ };
130
+
131
+ /** Anything React accepts as a ref, plus the absence of one. */
132
+ type PossibleRef<T> = Ref<T> | undefined;
133
+ /**
134
+ * The props `mergeProps` knows how to combine. Deliberately loose: it merges whatever a
135
+ * root hands to whatever child it was given, and neither side is knowable from here.
136
+ */
137
+ type MergeableProps = Record<string, unknown>;
138
+ type AsChildProps = {
139
+ /**
140
+ * Merge this component's props into its single child instead of rendering an element
141
+ * of its own — a navigation `Link` as a `Button`, a bespoke trigger as a `Select`.
142
+ */
143
+ asChild?: boolean;
144
+ };
145
+
146
+ type PortalProps = {
147
+ children: ReactNode;
148
+ };
149
+ /**
150
+ * Renders its children into the nearest `PortalHost` instead of where it sits. What
151
+ * `Dialog`, `Sheet`, `Drawer` and `Snackbar` are built on: an overlay has to escape the
152
+ * clipping and stacking of whatever container happened to hold the trigger.
153
+ *
154
+ * Both halves run in layout effects rather than effects, which is deliberate: the content
155
+ * lands in the same commit as the trigger's, so an overlay neither shows one frame late
156
+ * nor survives one frame past the unmount that closed it. The unpublish sits in its own
157
+ * effect so that it does not depend on `children` — a re-publish then keeps the portal's
158
+ * place in the host's order instead of dropping it and re-adding it at the end.
159
+ */
160
+ declare function Portal({ children }: PortalProps): null;
161
+ declare namespace Portal {
162
+ var displayName: string;
163
+ }
164
+
165
+ type PortalMethods = {
166
+ addPortal: (key: string, element: ReactNode) => void;
167
+ removePortal: (key: string) => void;
168
+ };
169
+ /**
170
+ * `null` outside a host, and `Portal` treats that as "render nothing" rather than
171
+ * throwing: an app that forgot `PortalHost` should lose its overlays, not crash on the
172
+ * first `Dialog`.
173
+ */
174
+ declare const PortalContext: react.Context<PortalMethods | null>;
175
+
176
+ type PortalHostProps = {
177
+ children: ReactNode;
178
+ };
179
+ /**
180
+ * Where every `Portal` in the tree below renders. Mounted once, at the root of the app,
181
+ * above navigation — an overlay that renders inside a screen is clipped by it.
182
+ */
183
+ declare function PortalHost({ children }: PortalHostProps): react.JSX.Element;
184
+ declare namespace PortalHost {
185
+ var displayName: string;
186
+ }
187
+
188
+ /**
189
+ * R3: the string a root should wrap in its default text slot, or `null` when it should
190
+ * render its children as they are.
191
+ *
192
+ * The whole tree is stringified recursively rather than the first child inspected. That
193
+ * is what makes `<Button>{count} items</Button>` work — children there are the array
194
+ * `[3, ' items']`, and an `isValidElement` check on the first entry would call it an
195
+ * element-free tree only by accident, while a check for "is the first child a string"
196
+ * would miss it outright.
197
+ *
198
+ * `null` for an empty result as much as for a tree containing an element: in both cases
199
+ * there is nothing to wrap, and a root's fallback — render the children — is right for
200
+ * both. It also keeps `<Button>{false}</Button>` from mounting an empty text node.
201
+ */
202
+ declare function childrenToString(children: ReactNode): string | null;
203
+
204
+ /**
205
+ * A context a slot cannot read by accident. Every compound gets one, and it carries
206
+ * **resolved** values — style references the root already computed, not tokens for the
207
+ * slot to resolve again (R5).
208
+ *
209
+ * ```ts
210
+ * const [ButtonProvider, useButton] = createSlotContext<ButtonContext>('Button')
211
+ * ```
212
+ *
213
+ * The tuple is what lets each compound name its own hook, which R10 requires it to
214
+ * export. `name` gives both halves of the error, so there is one place to spell it.
215
+ */
216
+ declare function createSlotContext<T>(name: string): readonly [Provider<T | null>, () => T];
217
+
218
+ /**
219
+ * Merges a root's own props into the child it renders through `asChild` (R12). Four
220
+ * rules, and the child wins wherever they do not apply — it is the more specific intent:
221
+ *
222
+ * - **Event handlers compose.** Both run, ours first: the component's own behaviour (the
223
+ * press state that drives its styles) happens before the child's side effect (the
224
+ * navigation). Replacing one with the other is the bug this exists to prevent.
225
+ * - **Styles stack**, ours under the child's, so the child can override.
226
+ * - **`ref`s merge** through `mergeRefs`. React 19 passes `ref` as an ordinary prop, so
227
+ * it arrives here rather than beside the props, and dropping it would sever the root's
228
+ * handle on the node.
229
+ * - **Everything else: the child's value wins**, and ours fills in what it left unset.
230
+ */
231
+ declare function mergeProps(ours: MergeableProps, theirs: MergeableProps): MergeableProps;
232
+
233
+ /**
234
+ * One callback that feeds several refs — what lets a root keep its own handle on a node
235
+ * while still honouring the ref its caller passed (R9), and what `asChild` needs to
236
+ * forward a ref into the child it merges into (R12).
237
+ *
238
+ * It returns nothing on purpose. React 19 reads a ref callback's return value as a
239
+ * cleanup function while React 18 ignores it, and this package supports both; letting
240
+ * a merged cleanup through would behave differently on each. React calls every ref with
241
+ * `null` on unmount anyway, which this forwards.
242
+ */
243
+ declare function mergeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T>;
244
+
245
+ type SlotProps = MergeableProps & {
246
+ children?: ReactNode;
247
+ };
248
+ /**
249
+ * The render branch behind `asChild` (R12). A root picks it instead of its own element:
250
+ *
251
+ * ```tsx
252
+ * const Root = asChild ? Slot : Pressable
253
+ * return <Root ref={ref} {...rootProps}>{children}</Root>
254
+ * ```
255
+ *
256
+ * One line per root, which is the point — forty-seven roots each hand-rolling a
257
+ * `cloneElement` and a ref merge would drift, and R12 has to hold uniformly from the
258
+ * first component or the ref signature of the whole core changes later.
259
+ */
260
+ declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
261
+
262
+ export { AnimationProp, type AsChildProps, FeedbackContext, FeedbackVariant, HIGHLIGHT_OPACITY, Icon, IconContext, IconContextValue, IconProps, type MergeableProps, PRESS_DURATION, PRESS_SCALE, Portal, PortalContext, PortalHost, type PortalHostProps, type PortalMethods, type PortalProps, type PossibleRef, PressableFeedback, type PressableFeedbackHighlightProps, type PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, ResolvedAnimation, Slot, SlotAnimation, type SlotProps, childrenToString, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback, useIconContext };
@@ -0,0 +1,262 @@
1
+ import * as react from 'react';
2
+ import { Ref, ReactNode, Provider, RefCallback } from 'react';
3
+ import { b as IconProps, a as IconContextValue, S as SlotAnimation, F as FeedbackContext, c as AnimationProp, R as ResolvedAnimation, d as FeedbackVariant } from '../create-recipe-Dn9kj5Rs.js';
4
+ export { A as AnimationConfig, h as Axes, C as CompoundVariant, I as IconComponentProps, P as PressableFeedbackProps, f as Recipe, i as RecipeConfig, g as ResolveArgs, j as ResolvedSelection, k as ResolvedStyles, l as Selection, m as SlotStyle, n as SlotStyles, o as StateName, p as States, q as StyleFn, T as TintArgs, V as VariantColors, r as VariantRole, s as VariantTokens, e as createRecipe } from '../create-recipe-Dn9kj5Rs.js';
5
+ import * as react_native from 'react-native';
6
+ import { StyleProp, ViewStyle } from 'react-native';
7
+ import 'react-native-reanimated';
8
+ import '../theme.type-C9bFJKFm.js';
9
+
10
+ /**
11
+ * The gap nobody else closes: an icon is a third-party component, so a slot context does
12
+ * not reach it and every call site ends up computing the colour by hand.
13
+ *
14
+ * ```tsx
15
+ * <Button variant="danger">
16
+ * <Button.Icon as={TrashIcon} /> {/* colour and size inherited, nothing to pass *\/}
17
+ * <Button.Label>Supprimer</Button.Label>
18
+ * </Button>
19
+ * ```
20
+ *
21
+ * Three accepted forms — a component through `as`, a raw SVG as children, or an image
22
+ * through `source` — and the resolution is the same for all three: an explicit prop, else
23
+ * what the surrounding slot published, else the theme.
24
+ */
25
+ declare function Icon({ as: Component, children, source, size, color, style, }: IconProps): react.JSX.Element;
26
+ declare namespace Icon {
27
+ var displayName: string;
28
+ }
29
+
30
+ /**
31
+ * Not a `createSlotContext`: that one throws outside its parent, and an `Icon` has to
32
+ * work on its own as much as inside a `Button`. An empty context is the honest default —
33
+ * nothing inherited, so the theme decides.
34
+ */
35
+ declare const IconContext: react.Context<IconContextValue>;
36
+ declare function useIconContext(): IconContextValue;
37
+
38
+ type PressableFeedbackHighlightProps = {
39
+ style?: StyleProp<ViewStyle>;
40
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
41
+ animation?: SlotAnimation;
42
+ };
43
+ /**
44
+ * The press wash: one flat overlay fading in under the finger.
45
+ *
46
+ * It is a **neutral** wash, not the variant's pressed colour. A component picks one or
47
+ * the other — this overlay, or a `pressed` state in its recipe swapping `bg` for
48
+ * `bgPressed` — never both, or a pressed button darkens twice.
49
+ */
50
+ declare function PressableFeedbackHighlight({ style, animation: override, }: PressableFeedbackHighlightProps): react.JSX.Element;
51
+ declare namespace PressableFeedbackHighlight {
52
+ var displayName: string;
53
+ }
54
+
55
+ type PressableFeedbackRippleProps = {
56
+ style?: StyleProp<ViewStyle>;
57
+ /** Overrides the blanket `animation` on the root, for this overlay only. */
58
+ animation?: SlotAnimation;
59
+ };
60
+ /**
61
+ * A circle washing outwards from where the finger landed.
62
+ *
63
+ * It is a **one-shot, independent of how long the press lasts**: the wave runs its course
64
+ * and ends, the way a ripple in water does. Tying it to the press would leave a disc
65
+ * parked on the control for as long as a finger rests there.
66
+ *
67
+ * It needs the root to clip — `PressableFeedback` sets `overflow: 'hidden'` when it
68
+ * mounts one — and it renders nothing on the static branch: a ripple that cannot expand
69
+ * is a coloured disc sitting on the control, which reads as a defect rather than as
70
+ * reduced motion.
71
+ */
72
+ declare function PressableFeedbackRipple({ style, animation: override, }: PressableFeedbackRippleProps): react.JSX.Element | null;
73
+ declare namespace PressableFeedbackRipple {
74
+ var displayName: string;
75
+ }
76
+
77
+ declare const useFeedback: () => FeedbackContext;
78
+
79
+ /**
80
+ * The values the v0 tree shipped with (`Animated.spring` to `0.975`, `bounciness: 0`,
81
+ * over roughly 100ms). Kept identical on purpose: the touch feedback is the part of a
82
+ * library users feel rather than read, and changing its timing in a rewrite would be a
83
+ * regression nobody asked for. `bounciness: 0` is why a duration replaces the spring —
84
+ * a spring with no bounce is a curve.
85
+ */
86
+ declare const PRESS_SCALE = 0.975;
87
+ declare const PRESS_DURATION = 100;
88
+ declare const RELEASE_DURATION = 150;
89
+ /** How far the wash and the ripple go at full press. */
90
+ declare const HIGHLIGHT_OPACITY = 0.08;
91
+ declare const RIPPLE_OPACITY = 0.12;
92
+ declare const RIPPLE_DURATION = 350;
93
+ /**
94
+ * The circle's radius as a multiple of the control's diagonal. Above 1 it covers from
95
+ * any point on the control, so where the finger landed never enters the calculation.
96
+ */
97
+ declare const RIPPLE_COVERAGE = 1.25;
98
+ /**
99
+ * One shape out of four accepted ones, so the components read a record instead of
100
+ * re-deciding what `'disable-all'` meant.
101
+ *
102
+ * `inheritedDisableAll` comes from an ancestor that asked for it, and it wins: a list
103
+ * that switched its rows' animations off cannot be overridden by a row.
104
+ */
105
+ declare function resolveAnimation(animation: AnimationProp | undefined, inheritedDisableAll?: boolean): ResolvedAnimation;
106
+ type ResolvedSlotAnimation = {
107
+ enabled: boolean;
108
+ duration: number;
109
+ opacity: number;
110
+ };
111
+ /**
112
+ * A slot's own `animation` over the root's blanket one, with the root winning when it
113
+ * switched everything off — `animation="disable-all"` on an ancestor cannot be undone by
114
+ * an overlay that asks nicely.
115
+ */
116
+ declare function resolveSlotAnimation(override: SlotAnimation | undefined, enabledByRoot: boolean, defaultOpacity: number, defaultDuration?: number): ResolvedSlotAnimation;
117
+
118
+ declare const PressableFeedback: react.ForwardRefExoticComponent<Omit<react_native.PressableProps, "children" | "style" | "disabled"> & {
119
+ isPressed?: boolean;
120
+ isDisabled?: boolean;
121
+ asChild?: boolean;
122
+ feedbackVariant?: FeedbackVariant;
123
+ animation?: AnimationProp;
124
+ style?: react_native.StyleProp<react_native.ViewStyle>;
125
+ children?: react.ReactNode;
126
+ } & react.RefAttributes<react_native.View>> & {
127
+ Highlight: typeof PressableFeedbackHighlight;
128
+ Ripple: typeof PressableFeedbackRipple;
129
+ };
130
+
131
+ /** Anything React accepts as a ref, plus the absence of one. */
132
+ type PossibleRef<T> = Ref<T> | undefined;
133
+ /**
134
+ * The props `mergeProps` knows how to combine. Deliberately loose: it merges whatever a
135
+ * root hands to whatever child it was given, and neither side is knowable from here.
136
+ */
137
+ type MergeableProps = Record<string, unknown>;
138
+ type AsChildProps = {
139
+ /**
140
+ * Merge this component's props into its single child instead of rendering an element
141
+ * of its own — a navigation `Link` as a `Button`, a bespoke trigger as a `Select`.
142
+ */
143
+ asChild?: boolean;
144
+ };
145
+
146
+ type PortalProps = {
147
+ children: ReactNode;
148
+ };
149
+ /**
150
+ * Renders its children into the nearest `PortalHost` instead of where it sits. What
151
+ * `Dialog`, `Sheet`, `Drawer` and `Snackbar` are built on: an overlay has to escape the
152
+ * clipping and stacking of whatever container happened to hold the trigger.
153
+ *
154
+ * Both halves run in layout effects rather than effects, which is deliberate: the content
155
+ * lands in the same commit as the trigger's, so an overlay neither shows one frame late
156
+ * nor survives one frame past the unmount that closed it. The unpublish sits in its own
157
+ * effect so that it does not depend on `children` — a re-publish then keeps the portal's
158
+ * place in the host's order instead of dropping it and re-adding it at the end.
159
+ */
160
+ declare function Portal({ children }: PortalProps): null;
161
+ declare namespace Portal {
162
+ var displayName: string;
163
+ }
164
+
165
+ type PortalMethods = {
166
+ addPortal: (key: string, element: ReactNode) => void;
167
+ removePortal: (key: string) => void;
168
+ };
169
+ /**
170
+ * `null` outside a host, and `Portal` treats that as "render nothing" rather than
171
+ * throwing: an app that forgot `PortalHost` should lose its overlays, not crash on the
172
+ * first `Dialog`.
173
+ */
174
+ declare const PortalContext: react.Context<PortalMethods | null>;
175
+
176
+ type PortalHostProps = {
177
+ children: ReactNode;
178
+ };
179
+ /**
180
+ * Where every `Portal` in the tree below renders. Mounted once, at the root of the app,
181
+ * above navigation — an overlay that renders inside a screen is clipped by it.
182
+ */
183
+ declare function PortalHost({ children }: PortalHostProps): react.JSX.Element;
184
+ declare namespace PortalHost {
185
+ var displayName: string;
186
+ }
187
+
188
+ /**
189
+ * R3: the string a root should wrap in its default text slot, or `null` when it should
190
+ * render its children as they are.
191
+ *
192
+ * The whole tree is stringified recursively rather than the first child inspected. That
193
+ * is what makes `<Button>{count} items</Button>` work — children there are the array
194
+ * `[3, ' items']`, and an `isValidElement` check on the first entry would call it an
195
+ * element-free tree only by accident, while a check for "is the first child a string"
196
+ * would miss it outright.
197
+ *
198
+ * `null` for an empty result as much as for a tree containing an element: in both cases
199
+ * there is nothing to wrap, and a root's fallback — render the children — is right for
200
+ * both. It also keeps `<Button>{false}</Button>` from mounting an empty text node.
201
+ */
202
+ declare function childrenToString(children: ReactNode): string | null;
203
+
204
+ /**
205
+ * A context a slot cannot read by accident. Every compound gets one, and it carries
206
+ * **resolved** values — style references the root already computed, not tokens for the
207
+ * slot to resolve again (R5).
208
+ *
209
+ * ```ts
210
+ * const [ButtonProvider, useButton] = createSlotContext<ButtonContext>('Button')
211
+ * ```
212
+ *
213
+ * The tuple is what lets each compound name its own hook, which R10 requires it to
214
+ * export. `name` gives both halves of the error, so there is one place to spell it.
215
+ */
216
+ declare function createSlotContext<T>(name: string): readonly [Provider<T | null>, () => T];
217
+
218
+ /**
219
+ * Merges a root's own props into the child it renders through `asChild` (R12). Four
220
+ * rules, and the child wins wherever they do not apply — it is the more specific intent:
221
+ *
222
+ * - **Event handlers compose.** Both run, ours first: the component's own behaviour (the
223
+ * press state that drives its styles) happens before the child's side effect (the
224
+ * navigation). Replacing one with the other is the bug this exists to prevent.
225
+ * - **Styles stack**, ours under the child's, so the child can override.
226
+ * - **`ref`s merge** through `mergeRefs`. React 19 passes `ref` as an ordinary prop, so
227
+ * it arrives here rather than beside the props, and dropping it would sever the root's
228
+ * handle on the node.
229
+ * - **Everything else: the child's value wins**, and ours fills in what it left unset.
230
+ */
231
+ declare function mergeProps(ours: MergeableProps, theirs: MergeableProps): MergeableProps;
232
+
233
+ /**
234
+ * One callback that feeds several refs — what lets a root keep its own handle on a node
235
+ * while still honouring the ref its caller passed (R9), and what `asChild` needs to
236
+ * forward a ref into the child it merges into (R12).
237
+ *
238
+ * It returns nothing on purpose. React 19 reads a ref callback's return value as a
239
+ * cleanup function while React 18 ignores it, and this package supports both; letting
240
+ * a merged cleanup through would behave differently on each. React calls every ref with
241
+ * `null` on unmount anyway, which this forwards.
242
+ */
243
+ declare function mergeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T>;
244
+
245
+ type SlotProps = MergeableProps & {
246
+ children?: ReactNode;
247
+ };
248
+ /**
249
+ * The render branch behind `asChild` (R12). A root picks it instead of its own element:
250
+ *
251
+ * ```tsx
252
+ * const Root = asChild ? Slot : Pressable
253
+ * return <Root ref={ref} {...rootProps}>{children}</Root>
254
+ * ```
255
+ *
256
+ * One line per root, which is the point — forty-seven roots each hand-rolling a
257
+ * `cloneElement` and a ref merge would drift, and R12 has to hold uniformly from the
258
+ * first component or the ref signature of the whole core changes later.
259
+ */
260
+ declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
261
+
262
+ export { AnimationProp, type AsChildProps, FeedbackContext, FeedbackVariant, HIGHLIGHT_OPACITY, Icon, IconContext, IconContextValue, IconProps, type MergeableProps, PRESS_DURATION, PRESS_SCALE, Portal, PortalContext, PortalHost, type PortalHostProps, type PortalMethods, type PortalProps, type PossibleRef, PressableFeedback, type PressableFeedbackHighlightProps, type PressableFeedbackRippleProps, RELEASE_DURATION, RIPPLE_COVERAGE, RIPPLE_DURATION, RIPPLE_OPACITY, ResolvedAnimation, Slot, SlotAnimation, type SlotProps, childrenToString, createSlotContext, mergeProps, mergeRefs, resolveAnimation, resolveSlotAnimation, useFeedback, useIconContext };
@@ -0,0 +1,53 @@
1
+ import {
2
+ Portal,
3
+ PortalContext,
4
+ PortalHost
5
+ } from "../chunk-3TIDEII6.js";
6
+ import {
7
+ HIGHLIGHT_OPACITY,
8
+ Icon,
9
+ IconContext,
10
+ PRESS_DURATION,
11
+ PRESS_SCALE,
12
+ PressableFeedback,
13
+ RELEASE_DURATION,
14
+ RIPPLE_COVERAGE,
15
+ RIPPLE_DURATION,
16
+ RIPPLE_OPACITY,
17
+ Slot,
18
+ childrenToString,
19
+ createRecipe,
20
+ createSlotContext,
21
+ mergeProps,
22
+ mergeRefs,
23
+ resolveAnimation,
24
+ resolveSlotAnimation,
25
+ useFeedback,
26
+ useIconContext
27
+ } from "../chunk-66OVPWF4.js";
28
+ import "../chunk-X2K2FX3W.js";
29
+ export {
30
+ HIGHLIGHT_OPACITY,
31
+ Icon,
32
+ IconContext,
33
+ PRESS_DURATION,
34
+ PRESS_SCALE,
35
+ Portal,
36
+ PortalContext,
37
+ PortalHost,
38
+ PressableFeedback,
39
+ RELEASE_DURATION,
40
+ RIPPLE_COVERAGE,
41
+ RIPPLE_DURATION,
42
+ RIPPLE_OPACITY,
43
+ Slot,
44
+ childrenToString,
45
+ createRecipe,
46
+ createSlotContext,
47
+ mergeProps,
48
+ mergeRefs,
49
+ resolveAnimation,
50
+ resolveSlotAnimation,
51
+ useFeedback,
52
+ useIconContext
53
+ };
@@ -9,13 +9,14 @@
9
9
 
10
10
 
11
11
 
12
+ var _chunk2FEDC7U5cjs = require('../chunk-2FEDC7U5.cjs');
12
13
 
13
14
 
14
15
 
15
16
 
16
- var _chunkJDS6KGCMcjs = require('../chunk-JDS6KGCM.cjs');
17
17
 
18
18
 
19
+ var _chunk3QBT3Q65cjs = require('../chunk-3QBT3Q65.cjs');
19
20
 
20
21
 
21
22
 
@@ -29,4 +30,7 @@ var _chunkJDS6KGCMcjs = require('../chunk-JDS6KGCM.cjs');
29
30
 
30
31
 
31
32
 
32
- exports.ThemeContext = _chunkJDS6KGCMcjs.ThemeContext; exports.XAUIProvider = _chunkJDS6KGCMcjs.XAUIProvider; exports.buildRadius = _chunkJDS6KGCMcjs.buildRadius; exports.buildShadows = _chunkJDS6KGCMcjs.buildShadows; exports.createTheme = _chunkJDS6KGCMcjs.createTheme; exports.defaultTheme = _chunkJDS6KGCMcjs.defaultTheme; exports.deriveColors = _chunkJDS6KGCMcjs.deriveColors; exports.palette = _chunkJDS6KGCMcjs.palette; exports.primitives = _chunkJDS6KGCMcjs.primitives; exports.sourceKeys = _chunkJDS6KGCMcjs.sourceKeys; exports.tokens = _chunkJDS6KGCMcjs.tokens; exports.useColorMode = _chunkJDS6KGCMcjs.useColorMode; exports.useThemeColor = _chunkJDS6KGCMcjs.useThemeColor; exports.useXAUITheme = _chunkJDS6KGCMcjs.useXAUITheme;
33
+
34
+
35
+
36
+ exports.ThemeContext = _chunk3QBT3Q65cjs.ThemeContext; exports.XAUIProvider = _chunk2FEDC7U5cjs.XAUIProvider; exports.buildRadius = _chunk2FEDC7U5cjs.buildRadius; exports.buildShadows = _chunk2FEDC7U5cjs.buildShadows; exports.createTheme = _chunk2FEDC7U5cjs.createTheme; exports.defaultTheme = _chunk2FEDC7U5cjs.defaultTheme; exports.deriveColors = _chunk2FEDC7U5cjs.deriveColors; exports.deriveTint = _chunk3QBT3Q65cjs.deriveTint; exports.palette = _chunk2FEDC7U5cjs.palette; exports.primitives = _chunk2FEDC7U5cjs.primitives; exports.sourceKeys = _chunk2FEDC7U5cjs.sourceKeys; exports.tokens = _chunk2FEDC7U5cjs.tokens; exports.useColorMode = _chunk3QBT3Q65cjs.useColorMode; exports.useThemeColor = _chunk3QBT3Q65cjs.useThemeColor; exports.useXAUITheme = _chunk3QBT3Q65cjs.useXAUITheme;