@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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/chunk-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +22 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +17 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import { V as ViewStyleProps } from './style-props.type-CfnoGEP7.cjs';
|
|
5
|
+
|
|
6
|
+
type AnimationConfig = {
|
|
7
|
+
scale?: boolean;
|
|
8
|
+
highlight?: boolean;
|
|
9
|
+
ripple?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `false` and `'disabled'` turn this component's animations off. `'disable-all'` turns
|
|
13
|
+
* them off for its descendants too — a long list kills every row's worklets with one
|
|
14
|
+
* prop instead of threading it down. An object switches them off one at a time.
|
|
15
|
+
*/
|
|
16
|
+
type AnimationProp = boolean | 'disabled' | 'disable-all' | AnimationConfig;
|
|
17
|
+
/** `animation` once normalised — what the components actually read. */
|
|
18
|
+
type ResolvedAnimation = {
|
|
19
|
+
scale: boolean;
|
|
20
|
+
highlight: boolean;
|
|
21
|
+
ripple: boolean;
|
|
22
|
+
/** True when every sub-animation is off: the branch that mounts no worklet at all. */
|
|
23
|
+
none: boolean;
|
|
24
|
+
/** Propagated to descendants through context. */
|
|
25
|
+
disableAll: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* R14 — it renders a `Pressable`, so it takes that node's style keys as props. The
|
|
29
|
+
* primitive every pressable component in the library is built on cannot be the one place
|
|
30
|
+
* where `padding={16}` has to become an object again.
|
|
31
|
+
*/
|
|
32
|
+
type PressableFeedbackProps = Omit<PressableProps, 'style' | 'children' | 'disabled'> & ViewStyleProps & {
|
|
33
|
+
/** Controlled: the root owns the state, because its recipe resolves on it (R5). */
|
|
34
|
+
isPressed?: boolean;
|
|
35
|
+
/** R8: `disabled` is not part of the public vocabulary, `isX` is. */
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Merge into the single child instead of rendering a pressable (R12) — **keeping the
|
|
39
|
+
* feedback**. Swapping this component out for a bare `Slot` would silently drop the
|
|
40
|
+
* touch feedback of every `asChild` control.
|
|
41
|
+
*/
|
|
42
|
+
asChild?: boolean;
|
|
43
|
+
animation?: AnimationProp;
|
|
44
|
+
style?: StyleProp<ViewStyle>;
|
|
45
|
+
/**
|
|
46
|
+
* The overlays are children, not a prop — `<PressableFeedback.Highlight />` or
|
|
47
|
+
* `<PressableFeedback.Ripple />`, in any order: the root paints them under everything
|
|
48
|
+
* else wherever they sit. The scale is the root's own and needs nothing rendered.
|
|
49
|
+
*
|
|
50
|
+
* `Pressable`'s function form is dropped on purpose. It exists to hand the press state
|
|
51
|
+
* to children; here the root above already owns that state and this publishes it
|
|
52
|
+
* through context, so the function form would be a second, quieter source of truth.
|
|
53
|
+
*/
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A slot's own animation, overriding the blanket one on the root. `false` switches that
|
|
58
|
+
* slot off; the object tunes it. Deliberately two knobs rather than a full timing
|
|
59
|
+
* surface — anything past this is a different animation, and that is a component's job,
|
|
60
|
+
* not a prop's.
|
|
61
|
+
*/
|
|
62
|
+
type SlotAnimation = boolean | {
|
|
63
|
+
/** Milliseconds. Falls back to the shared press timing. */
|
|
64
|
+
duration?: number;
|
|
65
|
+
/** How far the overlay goes at full press, 0 to 1. */
|
|
66
|
+
opacity?: number;
|
|
67
|
+
};
|
|
68
|
+
/** One ripple wave. Two of them, so a rapid double tap does not cut the one in flight. */
|
|
69
|
+
type RippleWave = {
|
|
70
|
+
/** `0 → 1` as the circle opens. */
|
|
71
|
+
expand: SharedValue<number>;
|
|
72
|
+
/** `0 → 1` as the ink arrives, on its own curve. */
|
|
73
|
+
alpha: SharedValue<number>;
|
|
74
|
+
/** Where the finger landed, in the root's coordinates. */
|
|
75
|
+
origin: SharedValue<{
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The corner keys an overlay copies off the root. The `Left`/`Right` forms are absent
|
|
82
|
+
* rather than forgotten: R13 bans them, because RN mirrors only the logical ones under RTL.
|
|
83
|
+
*/
|
|
84
|
+
type RadiusStyle = Pick<ViewStyle, 'borderRadius' | 'borderStartStartRadius' | 'borderStartEndRadius' | 'borderEndStartRadius' | 'borderEndEndRadius'>;
|
|
85
|
+
type FeedbackContext = {
|
|
86
|
+
/**
|
|
87
|
+
* The overlay's ink, resolved by the root from its own background.
|
|
88
|
+
*
|
|
89
|
+
* A wash or a wave has to contrast with what it sits on, and only the root knows that —
|
|
90
|
+
* it flattens its own `style` and reads `backgroundColor`, then takes the contrasting
|
|
91
|
+
* side the same way a tint does. Black ink at 10% on a saturated fill is close to
|
|
92
|
+
* invisible, which is the one thing a press indicator cannot be.
|
|
93
|
+
*/
|
|
94
|
+
ink: string;
|
|
95
|
+
/**
|
|
96
|
+
* The root's own corners, so an overlay rounds itself to match. `corners` and not
|
|
97
|
+
* `radius`: the ripple already has a radius, and it is a length in points rather than a
|
|
98
|
+
* shape.
|
|
99
|
+
*
|
|
100
|
+
* An absolute fill has square corners and every control here is rounded, so without this
|
|
101
|
+
* both the wash and the wave paint outside the surface at each corner. The overlay
|
|
102
|
+
* carries the clip rather than the root: clipping the root would also cut a child that
|
|
103
|
+
* legitimately overflows — a badge on a button's corner — and that child has nothing to
|
|
104
|
+
* do with the press.
|
|
105
|
+
*/
|
|
106
|
+
corners: RadiusStyle;
|
|
107
|
+
isPressed: boolean;
|
|
108
|
+
animation: ResolvedAnimation;
|
|
109
|
+
/** Absent on the static branch, where nothing animates and no worklet is mounted. */
|
|
110
|
+
progress?: SharedValue<number>;
|
|
111
|
+
/** How big the root is — what the scale coefficient is computed from. */
|
|
112
|
+
size?: SharedValue<{
|
|
113
|
+
width: number;
|
|
114
|
+
height: number;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* The two ripple waves, driven by the **root**.
|
|
118
|
+
*
|
|
119
|
+
* They belong to the root because the root is the touch surface. An overlay carrying its
|
|
120
|
+
* own handlers only hears touches that land on *it* — and it is a sibling of the label,
|
|
121
|
+
* not its parent, so pressing the text of a button would do nothing. Touches bubble to
|
|
122
|
+
* the `Pressable`, which is why the handlers live there and the waves are published down.
|
|
123
|
+
*/
|
|
124
|
+
waves?: readonly [RippleWave, RippleWave];
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type { AnimationConfig as A, FeedbackContext as F, PressableFeedbackProps as P, RadiusStyle as R, SlotAnimation as S, AnimationProp as a, ResolvedAnimation as b, RippleWave as c };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import { V as ViewStyleProps } from './style-props.type-CfnoGEP7.js';
|
|
5
|
+
|
|
6
|
+
type AnimationConfig = {
|
|
7
|
+
scale?: boolean;
|
|
8
|
+
highlight?: boolean;
|
|
9
|
+
ripple?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `false` and `'disabled'` turn this component's animations off. `'disable-all'` turns
|
|
13
|
+
* them off for its descendants too — a long list kills every row's worklets with one
|
|
14
|
+
* prop instead of threading it down. An object switches them off one at a time.
|
|
15
|
+
*/
|
|
16
|
+
type AnimationProp = boolean | 'disabled' | 'disable-all' | AnimationConfig;
|
|
17
|
+
/** `animation` once normalised — what the components actually read. */
|
|
18
|
+
type ResolvedAnimation = {
|
|
19
|
+
scale: boolean;
|
|
20
|
+
highlight: boolean;
|
|
21
|
+
ripple: boolean;
|
|
22
|
+
/** True when every sub-animation is off: the branch that mounts no worklet at all. */
|
|
23
|
+
none: boolean;
|
|
24
|
+
/** Propagated to descendants through context. */
|
|
25
|
+
disableAll: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* R14 — it renders a `Pressable`, so it takes that node's style keys as props. The
|
|
29
|
+
* primitive every pressable component in the library is built on cannot be the one place
|
|
30
|
+
* where `padding={16}` has to become an object again.
|
|
31
|
+
*/
|
|
32
|
+
type PressableFeedbackProps = Omit<PressableProps, 'style' | 'children' | 'disabled'> & ViewStyleProps & {
|
|
33
|
+
/** Controlled: the root owns the state, because its recipe resolves on it (R5). */
|
|
34
|
+
isPressed?: boolean;
|
|
35
|
+
/** R8: `disabled` is not part of the public vocabulary, `isX` is. */
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Merge into the single child instead of rendering a pressable (R12) — **keeping the
|
|
39
|
+
* feedback**. Swapping this component out for a bare `Slot` would silently drop the
|
|
40
|
+
* touch feedback of every `asChild` control.
|
|
41
|
+
*/
|
|
42
|
+
asChild?: boolean;
|
|
43
|
+
animation?: AnimationProp;
|
|
44
|
+
style?: StyleProp<ViewStyle>;
|
|
45
|
+
/**
|
|
46
|
+
* The overlays are children, not a prop — `<PressableFeedback.Highlight />` or
|
|
47
|
+
* `<PressableFeedback.Ripple />`, in any order: the root paints them under everything
|
|
48
|
+
* else wherever they sit. The scale is the root's own and needs nothing rendered.
|
|
49
|
+
*
|
|
50
|
+
* `Pressable`'s function form is dropped on purpose. It exists to hand the press state
|
|
51
|
+
* to children; here the root above already owns that state and this publishes it
|
|
52
|
+
* through context, so the function form would be a second, quieter source of truth.
|
|
53
|
+
*/
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A slot's own animation, overriding the blanket one on the root. `false` switches that
|
|
58
|
+
* slot off; the object tunes it. Deliberately two knobs rather than a full timing
|
|
59
|
+
* surface — anything past this is a different animation, and that is a component's job,
|
|
60
|
+
* not a prop's.
|
|
61
|
+
*/
|
|
62
|
+
type SlotAnimation = boolean | {
|
|
63
|
+
/** Milliseconds. Falls back to the shared press timing. */
|
|
64
|
+
duration?: number;
|
|
65
|
+
/** How far the overlay goes at full press, 0 to 1. */
|
|
66
|
+
opacity?: number;
|
|
67
|
+
};
|
|
68
|
+
/** One ripple wave. Two of them, so a rapid double tap does not cut the one in flight. */
|
|
69
|
+
type RippleWave = {
|
|
70
|
+
/** `0 → 1` as the circle opens. */
|
|
71
|
+
expand: SharedValue<number>;
|
|
72
|
+
/** `0 → 1` as the ink arrives, on its own curve. */
|
|
73
|
+
alpha: SharedValue<number>;
|
|
74
|
+
/** Where the finger landed, in the root's coordinates. */
|
|
75
|
+
origin: SharedValue<{
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The corner keys an overlay copies off the root. The `Left`/`Right` forms are absent
|
|
82
|
+
* rather than forgotten: R13 bans them, because RN mirrors only the logical ones under RTL.
|
|
83
|
+
*/
|
|
84
|
+
type RadiusStyle = Pick<ViewStyle, 'borderRadius' | 'borderStartStartRadius' | 'borderStartEndRadius' | 'borderEndStartRadius' | 'borderEndEndRadius'>;
|
|
85
|
+
type FeedbackContext = {
|
|
86
|
+
/**
|
|
87
|
+
* The overlay's ink, resolved by the root from its own background.
|
|
88
|
+
*
|
|
89
|
+
* A wash or a wave has to contrast with what it sits on, and only the root knows that —
|
|
90
|
+
* it flattens its own `style` and reads `backgroundColor`, then takes the contrasting
|
|
91
|
+
* side the same way a tint does. Black ink at 10% on a saturated fill is close to
|
|
92
|
+
* invisible, which is the one thing a press indicator cannot be.
|
|
93
|
+
*/
|
|
94
|
+
ink: string;
|
|
95
|
+
/**
|
|
96
|
+
* The root's own corners, so an overlay rounds itself to match. `corners` and not
|
|
97
|
+
* `radius`: the ripple already has a radius, and it is a length in points rather than a
|
|
98
|
+
* shape.
|
|
99
|
+
*
|
|
100
|
+
* An absolute fill has square corners and every control here is rounded, so without this
|
|
101
|
+
* both the wash and the wave paint outside the surface at each corner. The overlay
|
|
102
|
+
* carries the clip rather than the root: clipping the root would also cut a child that
|
|
103
|
+
* legitimately overflows — a badge on a button's corner — and that child has nothing to
|
|
104
|
+
* do with the press.
|
|
105
|
+
*/
|
|
106
|
+
corners: RadiusStyle;
|
|
107
|
+
isPressed: boolean;
|
|
108
|
+
animation: ResolvedAnimation;
|
|
109
|
+
/** Absent on the static branch, where nothing animates and no worklet is mounted. */
|
|
110
|
+
progress?: SharedValue<number>;
|
|
111
|
+
/** How big the root is — what the scale coefficient is computed from. */
|
|
112
|
+
size?: SharedValue<{
|
|
113
|
+
width: number;
|
|
114
|
+
height: number;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* The two ripple waves, driven by the **root**.
|
|
118
|
+
*
|
|
119
|
+
* They belong to the root because the root is the touch surface. An overlay carrying its
|
|
120
|
+
* own handlers only hears touches that land on *it* — and it is a sibling of the label,
|
|
121
|
+
* not its parent, so pressing the text of a button would do nothing. Touches bubble to
|
|
122
|
+
* the `Pressable`, which is why the handlers live there and the waves are published down.
|
|
123
|
+
*/
|
|
124
|
+
waves?: readonly [RippleWave, RippleWave];
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type { AnimationConfig as A, FeedbackContext as F, PressableFeedbackProps as P, RadiusStyle as R, SlotAnimation as S, AnimationProp as a, ResolvedAnimation as b, RippleWave as c };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ViewStyle, TextStyle, ImageStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* R13 — React Native mirrors a layout under RTL through the Start/End properties and only
|
|
5
|
+
* those. A props API is exactly where someone writes `paddingLeft` without thinking, so
|
|
6
|
+
* the type removes the temptation instead of leaving it to a review.
|
|
7
|
+
*/
|
|
8
|
+
type DirectionalStyleKey = 'left' | 'right' | 'paddingLeft' | 'paddingRight' | 'marginLeft' | 'marginRight' | 'borderLeftWidth' | 'borderRightWidth' | 'borderLeftColor' | 'borderRightColor' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius';
|
|
9
|
+
/**
|
|
10
|
+
* `pointerEvents` is a style key *and* a `View` prop. R14 says the component's own prop
|
|
11
|
+
* wins, so it stays the prop it has always been and is not exposed twice — the one name
|
|
12
|
+
* where the two vocabularies collide.
|
|
13
|
+
*/
|
|
14
|
+
type ComponentOwnedStyleKey = 'pointerEvents';
|
|
15
|
+
/**
|
|
16
|
+
* The style keys of a node, exposed as props (R14). Not a maintained list: it derives
|
|
17
|
+
* from the React Native type, minus what R13 forbids.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* type CardProps = ViewStyleProps & { variant?: CardVariant }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
type StyleProps<Style> = Omit<Style, DirectionalStyleKey | ComponentOwnedStyleKey>;
|
|
24
|
+
/** A root, or any slot that renders a view. */
|
|
25
|
+
type ViewStyleProps = StyleProps<ViewStyle>;
|
|
26
|
+
/** A text slot — `color`, `fontSize`, `letterSpacing`… */
|
|
27
|
+
type TextStyleProps = StyleProps<TextStyle>;
|
|
28
|
+
/** An image slot — `resizeMode`, `tintColor`… */
|
|
29
|
+
type ImageStyleProps = StyleProps<ImageStyle>;
|
|
30
|
+
|
|
31
|
+
export type { DirectionalStyleKey as D, ImageStyleProps as I, StyleProps as S, TextStyleProps as T, ViewStyleProps as V };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ViewStyle, TextStyle, ImageStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* R13 — React Native mirrors a layout under RTL through the Start/End properties and only
|
|
5
|
+
* those. A props API is exactly where someone writes `paddingLeft` without thinking, so
|
|
6
|
+
* the type removes the temptation instead of leaving it to a review.
|
|
7
|
+
*/
|
|
8
|
+
type DirectionalStyleKey = 'left' | 'right' | 'paddingLeft' | 'paddingRight' | 'marginLeft' | 'marginRight' | 'borderLeftWidth' | 'borderRightWidth' | 'borderLeftColor' | 'borderRightColor' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius';
|
|
9
|
+
/**
|
|
10
|
+
* `pointerEvents` is a style key *and* a `View` prop. R14 says the component's own prop
|
|
11
|
+
* wins, so it stays the prop it has always been and is not exposed twice — the one name
|
|
12
|
+
* where the two vocabularies collide.
|
|
13
|
+
*/
|
|
14
|
+
type ComponentOwnedStyleKey = 'pointerEvents';
|
|
15
|
+
/**
|
|
16
|
+
* The style keys of a node, exposed as props (R14). Not a maintained list: it derives
|
|
17
|
+
* from the React Native type, minus what R13 forbids.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* type CardProps = ViewStyleProps & { variant?: CardVariant }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
type StyleProps<Style> = Omit<Style, DirectionalStyleKey | ComponentOwnedStyleKey>;
|
|
24
|
+
/** A root, or any slot that renders a view. */
|
|
25
|
+
type ViewStyleProps = StyleProps<ViewStyle>;
|
|
26
|
+
/** A text slot — `color`, `fontSize`, `letterSpacing`… */
|
|
27
|
+
type TextStyleProps = StyleProps<TextStyle>;
|
|
28
|
+
/** An image slot — `resizeMode`, `tintColor`… */
|
|
29
|
+
type ImageStyleProps = StyleProps<ImageStyle>;
|
|
30
|
+
|
|
31
|
+
export type { DirectionalStyleKey as D, ImageStyleProps as I, StyleProps as S, TextStyleProps as T, ViewStyleProps as V };
|
package/dist/system/index.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-GGW43Q37.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkWDDXU3OHcjs = require('../chunk-WDDXU3OH.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -10,18 +11,20 @@
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
var _chunkEKS3W46Mcjs = require('../chunk-EKS3W46M.cjs');
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
|
|
18
|
+
var _chunkZFOOJK37cjs = require('../chunk-ZFOOJK37.cjs');
|
|
16
19
|
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
|
|
24
|
+
var _chunk4KFKWBN5cjs = require('../chunk-4KFKWBN5.cjs');
|
|
21
25
|
|
|
22
|
-
var _chunkIYFGO523cjs = require('../chunk-IYFGO523.cjs');
|
|
23
|
-
require('../chunk-3QBT3Q65.cjs');
|
|
24
26
|
|
|
27
|
+
var _chunkF6CQ6CBIcjs = require('../chunk-F6CQ6CBI.cjs');
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
|
|
@@ -42,4 +45,70 @@ require('../chunk-3QBT3Q65.cjs');
|
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
|
|
49
|
+
var _chunk3E7CDKFOcjs = require('../chunk-3E7CDKFO.cjs');
|
|
50
|
+
require('../chunk-7DPL3ZDS.cjs');
|
|
51
|
+
require('../chunk-EJQCQPET.cjs');
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var _chunkFNEUOBCVcjs = require('../chunk-FNEUOBCV.cjs');
|
|
56
|
+
require('../chunk-57SJ4LJF.cjs');
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var _chunk7GHM4GKLcjs = require('../chunk-7GHM4GKL.cjs');
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
var _chunkH4E4HDEPcjs = require('../chunk-H4E4HDEP.cjs');
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var _chunkTK44VBIEcjs = require('../chunk-TK44VBIE.cjs');
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
exports.ChevronDownIcon = _chunk4KFKWBN5cjs.ChevronDownIcon; exports.CloseButton = _chunkZFOOJK37cjs.CloseButton; exports.FEEDBACK_OVERLAY = _chunk3E7CDKFOcjs.FEEDBACK_OVERLAY; exports.HIGHLIGHT_DURATION = _chunk3E7CDKFOcjs.HIGHLIGHT_DURATION; exports.HIGHLIGHT_OPACITY = _chunk3E7CDKFOcjs.HIGHLIGHT_OPACITY; exports.INDICATOR_ROTATION = _chunkEKS3W46Mcjs.INDICATOR_ROTATION; exports.INDICATOR_SPRING = _chunkEKS3W46Mcjs.INDICATOR_SPRING; exports.Icon = _chunk4KFKWBN5cjs.Icon; exports.IconContext = _chunk4KFKWBN5cjs.IconContext; exports.PRESS_DURATION = _chunk3E7CDKFOcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunk3E7CDKFOcjs.PRESS_SCALE; exports.Portal = _chunkWDDXU3OHcjs.Portal; exports.PortalContext = _chunkWDDXU3OHcjs.PortalContext; exports.PortalHost = _chunkWDDXU3OHcjs.PortalHost; exports.PressableFeedback = _chunk3E7CDKFOcjs.PressableFeedback; exports.RIPPLE_CONFIRM_DURATION = _chunk3E7CDKFOcjs.RIPPLE_CONFIRM_DURATION; exports.RIPPLE_EXPAND_DURATION = _chunk3E7CDKFOcjs.RIPPLE_EXPAND_DURATION; exports.RIPPLE_FADE_IN = _chunk3E7CDKFOcjs.RIPPLE_FADE_IN; exports.RIPPLE_FADE_OUT = _chunk3E7CDKFOcjs.RIPPLE_FADE_OUT; exports.RIPPLE_FADE_OUT_DELAY = _chunk3E7CDKFOcjs.RIPPLE_FADE_OUT_DELAY; exports.RIPPLE_OPACITY = _chunk3E7CDKFOcjs.RIPPLE_OPACITY; exports.RIPPLE_START_SCALE = _chunk3E7CDKFOcjs.RIPPLE_START_SCALE; exports.SCALE_REFERENCE_WIDTH = _chunk3E7CDKFOcjs.SCALE_REFERENCE_WIDTH; exports.SelectionFill = _chunkF6CQ6CBIcjs.SelectionFill; exports.Slot = _chunk7GHM4GKLcjs.Slot; exports.anchoredEntering = _chunkEKS3W46Mcjs.anchoredEntering; exports.anchoredExiting = _chunkEKS3W46Mcjs.anchoredExiting; exports.childrenToString = _chunk7GHM4GKLcjs.childrenToString; exports.closeButtonBase = _chunkZFOOJK37cjs.closeButtonBase; exports.createRecipe = _chunkFNEUOBCVcjs.createRecipe; exports.createSlotContext = _chunk7GHM4GKLcjs.createSlotContext; exports.markOverlay = _chunk3E7CDKFOcjs.markOverlay; exports.mergeProps = _chunk7GHM4GKLcjs.mergeProps; exports.mergeRefs = _chunkH4E4HDEPcjs.mergeRefs; exports.overlayEntering = _chunkEKS3W46Mcjs.overlayEntering; exports.overlayExiting = _chunkEKS3W46Mcjs.overlayExiting; exports.pressScaleFor = _chunk3E7CDKFOcjs.pressScaleFor; exports.radiusAxis = _chunkFNEUOBCVcjs.radiusAxis; exports.resolveAnimation = _chunk3E7CDKFOcjs.resolveAnimation; exports.resolveSlotAnimation = _chunk3E7CDKFOcjs.resolveSlotAnimation; exports.rippleRadiusFor = _chunk3E7CDKFOcjs.rippleRadiusFor; exports.useFeedback = _chunk3E7CDKFOcjs.useFeedback; exports.useIconContext = _chunk4KFKWBN5cjs.useIconContext; exports.useStyleProps = _chunkTK44VBIEcjs.useStyleProps;
|