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

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.
Files changed (143) hide show
  1. package/dist/chunk-27ZRTZEE.js +293 -0
  2. package/dist/chunk-3FV4COTM.js +68 -0
  3. package/dist/chunk-423RQBOX.js +21 -0
  4. package/dist/chunk-4GTAZM2C.js +174 -0
  5. package/dist/chunk-4XPLPQLM.cjs +147 -0
  6. package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
  7. package/dist/chunk-5GO7MAVY.cjs +74 -0
  8. package/dist/chunk-5RQ7AZPN.cjs +455 -0
  9. package/dist/chunk-5Z4P6WHR.cjs +525 -0
  10. package/dist/chunk-6RVCGLKZ.js +661 -0
  11. package/dist/chunk-7DPL3ZDS.cjs +21 -0
  12. package/dist/chunk-7EIHHOHP.cjs +42 -0
  13. package/dist/chunk-7SEZGVTY.js +62 -0
  14. package/dist/chunk-7XKQJQF2.cjs +70 -0
  15. package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
  16. package/dist/chunk-A5OCK3C2.js +525 -0
  17. package/dist/chunk-BA2DBSAN.js +102 -0
  18. package/dist/chunk-BFMTUMTU.js +669 -0
  19. package/dist/chunk-BVJQ3UPZ.js +62 -0
  20. package/dist/chunk-DFME724B.js +147 -0
  21. package/dist/chunk-E2CWBQTV.js +119 -0
  22. package/dist/chunk-E4TS6632.cjs +314 -0
  23. package/dist/chunk-EGLLDKN6.js +9 -0
  24. package/dist/chunk-EJQCQPET.cjs +9 -0
  25. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  26. package/dist/chunk-F6W3JQ7K.js +42 -0
  27. package/dist/chunk-FMZQW35T.js +431 -0
  28. package/dist/chunk-FNEUOBCV.cjs +174 -0
  29. package/dist/chunk-G7K652GC.js +145 -0
  30. package/dist/chunk-GGW42MY4.js +20 -0
  31. package/dist/chunk-GI24YJPE.js +314 -0
  32. package/dist/chunk-GLGU2WFL.cjs +190 -0
  33. package/dist/chunk-GPVNCJ3Z.cjs +696 -0
  34. package/dist/chunk-GVQOD3VW.js +74 -0
  35. package/dist/chunk-KOC3KQIT.js +124 -0
  36. package/dist/chunk-KPWZLUES.cjs +124 -0
  37. package/dist/chunk-KWCHSIMI.cjs +293 -0
  38. package/dist/chunk-MC7SY2QH.cjs +20 -0
  39. package/dist/chunk-N527BTY4.cjs +366 -0
  40. package/dist/chunk-NBFWWQFW.cjs +346 -0
  41. package/dist/chunk-NYRXUGVL.js +104 -0
  42. package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
  43. package/dist/chunk-Q3WFY5N3.js +366 -0
  44. package/dist/chunk-QGN2BBJO.cjs +104 -0
  45. package/dist/chunk-TGZZ3RZU.cjs +86 -0
  46. package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
  47. package/dist/chunk-UBQLKIZC.cjs +431 -0
  48. package/dist/chunk-URSKA2VR.js +190 -0
  49. package/dist/chunk-V4WDMM6Z.js +86 -0
  50. package/dist/chunk-VJEER76X.js +455 -0
  51. package/dist/chunk-VZBWYWEI.cjs +736 -0
  52. package/dist/chunk-WR7YLDVV.cjs +68 -0
  53. package/dist/chunk-X4HQ4H2V.js +701 -0
  54. package/dist/chunk-XFSW3ZNI.cjs +145 -0
  55. package/dist/chunk-XQFAUDR2.cjs +62 -0
  56. package/dist/chunk-YKL6XHM6.js +346 -0
  57. package/dist/chunk-ZP2E2H2G.cjs +119 -0
  58. package/dist/chunk-ZSLNGBDS.cjs +700 -0
  59. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  60. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  61. package/dist/components/alert/index.cjs +20 -0
  62. package/dist/components/alert/index.d.cts +169 -0
  63. package/dist/components/alert/index.d.ts +169 -0
  64. package/dist/components/alert/index.js +20 -0
  65. package/dist/components/button/index.cjs +21 -0
  66. package/dist/components/button/index.d.cts +613 -0
  67. package/dist/components/button/index.d.ts +613 -0
  68. package/dist/components/button/index.js +21 -0
  69. package/dist/components/card/index.cjs +22 -0
  70. package/dist/components/card/index.d.cts +620 -0
  71. package/dist/components/card/index.d.ts +620 -0
  72. package/dist/components/card/index.js +22 -0
  73. package/dist/components/checkbox/index.cjs +26 -0
  74. package/dist/components/checkbox/index.d.cts +1136 -0
  75. package/dist/components/checkbox/index.d.ts +1136 -0
  76. package/dist/components/checkbox/index.js +26 -0
  77. package/dist/components/chip/index.cjs +20 -0
  78. package/dist/components/chip/index.d.cts +608 -0
  79. package/dist/components/chip/index.d.ts +608 -0
  80. package/dist/components/chip/index.js +20 -0
  81. package/dist/components/input/index.cjs +25 -0
  82. package/dist/components/input/index.d.cts +205 -0
  83. package/dist/components/input/index.d.ts +205 -0
  84. package/dist/components/input/index.js +25 -0
  85. package/dist/components/input-group/index.cjs +27 -0
  86. package/dist/components/input-group/index.d.cts +270 -0
  87. package/dist/components/input-group/index.d.ts +270 -0
  88. package/dist/components/input-group/index.js +27 -0
  89. package/dist/components/input-otp/index.cjs +29 -0
  90. package/dist/components/input-otp/index.d.cts +325 -0
  91. package/dist/components/input-otp/index.d.ts +325 -0
  92. package/dist/components/input-otp/index.js +29 -0
  93. package/dist/components/radio/index.cjs +26 -0
  94. package/dist/components/radio/index.d.cts +1102 -0
  95. package/dist/components/radio/index.d.ts +1102 -0
  96. package/dist/components/radio/index.js +26 -0
  97. package/dist/components/spinner/index.cjs +16 -0
  98. package/dist/components/spinner/index.d.cts +104 -0
  99. package/dist/components/spinner/index.d.ts +104 -0
  100. package/dist/components/spinner/index.js +16 -0
  101. package/dist/components/switch/index.cjs +27 -0
  102. package/dist/components/switch/index.d.cts +1154 -0
  103. package/dist/components/switch/index.d.ts +1154 -0
  104. package/dist/components/switch/index.js +27 -0
  105. package/dist/components/text-area/index.cjs +14 -0
  106. package/dist/components/text-area/index.d.cts +73 -0
  107. package/dist/components/text-area/index.d.ts +73 -0
  108. package/dist/components/text-area/index.js +14 -0
  109. package/dist/components/typography/index.cjs +15 -0
  110. package/dist/components/typography/index.d.cts +116 -0
  111. package/dist/components/typography/index.d.ts +116 -0
  112. package/dist/components/typography/index.js +15 -0
  113. package/dist/components/view/index.cjs +17 -0
  114. package/dist/components/view/index.d.cts +152 -0
  115. package/dist/components/view/index.d.ts +152 -0
  116. package/dist/components/view/index.js +17 -0
  117. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  118. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  119. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  120. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  121. package/dist/index.cjs +246 -4
  122. package/dist/index.d.cts +109 -4
  123. package/dist/index.d.ts +109 -4
  124. package/dist/index.js +266 -24
  125. package/dist/input.type-BUMDlzL9.d.cts +167 -0
  126. package/dist/input.type-D2qgi03E.d.ts +167 -0
  127. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  128. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  129. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  130. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  131. package/dist/system/index.cjs +60 -3
  132. package/dist/system/index.d.cts +347 -181
  133. package/dist/system/index.d.ts +347 -181
  134. package/dist/system/index.js +71 -14
  135. package/dist/theme/index.cjs +4 -3
  136. package/dist/theme/index.d.cts +34 -23
  137. package/dist/theme/index.d.ts +34 -23
  138. package/dist/theme/index.js +3 -2
  139. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  140. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  141. package/package.json +174 -18
  142. package/dist/chunk-QAMNNTGM.js +0 -637
  143. package/dist/chunk-V63JO65F.cjs +0 -637
@@ -0,0 +1,167 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextProps, ViewProps } from 'react-native';
3
+ import { T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.js';
4
+ import { S as Size, R as RadiusKey } from './theme.type-C2gNHpEx.js';
5
+
6
+ type InputSlot = 'root' | 'label' | 'field' | 'textArea' | 'placeholder' | 'description' | 'error' | 'prefix' | 'suffix' | 'icon';
7
+ /**
8
+ * The library's four emphasis levels, narrowed like the `Card`'s (§1 bis). A field
9
+ * **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
10
+ * `success`, `warning` and `danger` are absent here for the same reason they are there.
11
+ *
12
+ * This is where the theme's `field*` family is finally read, and the four names split
13
+ * HeroUI's two-name `primary | secondary` by saying what each of their ends already is:
14
+ *
15
+ * - **`primary`** — the `fieldBackground` fill plus the theme's `field` shadow. HeroUI's
16
+ * `primary`, with the elevation their flat token only implies.
17
+ * - **`secondary`** — the neutral `default` fill. HeroUI's `secondary`, and the default
18
+ * here: on a plain background a white field is its border and nothing else, while on a
19
+ * card the `fieldBackground` token *is* the card's own colour.
20
+ * - **`tertiary`** — the border alone, no fill. The same drop the `Button`'s `tertiary`
21
+ * makes.
22
+ * - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
23
+ * to move, so its focus shows in the caret alone.
24
+ *
25
+ * The first three name the `fieldBorder` edge and `ghost` gives it up. Its width is the
26
+ * theme's `borderWidth.field` — HeroUI's `--field-border-width`, which they ship at `0`
27
+ * and we ship at `1`. That is the one shipped default where the two differ;
28
+ * `createTheme({ borderWidth: { field: 0 } })` reproduces theirs.
29
+ */
30
+ type InputVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
31
+ /**
32
+ * Where the label sits relative to the field's box.
33
+ *
34
+ * `outside` is the label above the box, in the column's flow. `inside` lifts it into the
35
+ * box, above the text — the label is taken **out of flow** and placed against the box's
36
+ * own padding, so the JSX is identical either way and nothing is reparented (R4).
37
+ *
38
+ * Because the inside label positions itself against the top of the root, it assumes the
39
+ * field is the first thing in the column's flow: write `Input.Description` and
40
+ * `Input.Error` after the field, which is where they belong anyway.
41
+ */
42
+ type InputLabelPlacement = 'outside' | 'inside';
43
+ type InputSize = Size;
44
+ /**
45
+ * What the `Input` itself understands. R14 — a name in here is the component's, so the
46
+ * style prop that shares it is not exposed: `size` is the field's scale and never
47
+ * `ViewStyle`'s, and `color` is R7's tint.
48
+ */
49
+ type InputOwnProps = {
50
+ variant?: InputVariant;
51
+ /** The field's height, its padding, the gaps and the type. Never width. */
52
+ size?: InputSize;
53
+ /** Overrides the `field` radius the theme chose for every size. */
54
+ radius?: RadiusKey;
55
+ /** Above the box, or lifted into it. @default 'outside' */
56
+ labelPlacement?: InputLabelPlacement;
57
+ /**
58
+ * A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
59
+ * tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
60
+ * colour is a role like any other, it is also what the field borders on focus.
61
+ */
62
+ color?: string;
63
+ /**
64
+ * Paints the border, the label and the description in `danger`, and takes the focus
65
+ * treatment off: an error outranks focus, and a field that is both should read as
66
+ * wrong rather than as busy.
67
+ *
68
+ * It does **not** mount or unmount `Input.Error`. That stays the caller's — a slot that
69
+ * silently renders nothing is a slot you cannot debug.
70
+ */
71
+ isInvalid?: boolean;
72
+ /** Dims the field and makes it uneditable. */
73
+ isDisabled?: boolean;
74
+ style?: StyleProp<ViewStyle>;
75
+ children?: ReactNode;
76
+ };
77
+ /**
78
+ * R14 — the input's own props, the wrapper `View`'s, and every `ViewStyle` key neither
79
+ * already claims. **`TextInputProps` are not here**: they belong to `Input.Field`, which
80
+ * is the node that has them.
81
+ */
82
+ type InputProps = InputOwnProps & Omit<ViewProps, keyof InputOwnProps> & Omit<ViewStyleProps, keyof InputOwnProps | keyof ViewProps> & {
83
+ /** R12 — merge into the single child instead of rendering a `View`. */
84
+ asChild?: boolean;
85
+ };
86
+ /**
87
+ * Everything `TextInput` accepts, plus the `TextStyle` keys as props (R14).
88
+ *
89
+ * `editable` is absent: it is `disabled` under another name, and R8 keeps that off the
90
+ * public surface — `isDisabled` on the root is what stops the field.
91
+ */
92
+ type InputFieldProps = Omit<TextInputProps, 'editable'> & Omit<TextStyleProps, keyof TextInputProps>;
93
+ /** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
94
+ type InputTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
95
+ children?: ReactNode;
96
+ };
97
+ type InputLabelProps = InputTextProps;
98
+ type InputDescriptionProps = InputTextProps;
99
+ type InputErrorProps = InputTextProps;
100
+ /**
101
+ * Read off `TextInput`'s own props rather than spelled out: React Native has renamed the
102
+ * payload of these two more than once, and a hand-written `NativeSyntheticEvent<…>` here
103
+ * would be a second declaration free to drift from the node that actually fires them.
104
+ */
105
+ type FieldFocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];
106
+ type FieldBlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];
107
+ /**
108
+ * R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
109
+ * cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
110
+ * merges its own `style` on top and does no work of its own.
111
+ */
112
+ type InputContextValue = {
113
+ labelStyle: StyleProp<TextStyle>;
114
+ fieldStyle: StyleProp<TextStyle>;
115
+ /** Layered *over* `fieldStyle` by `Input.TextArea`: only what a multiline field adds. */
116
+ textAreaStyle: StyleProp<TextStyle>;
117
+ /**
118
+ * Values, not a style: `rows` is a raw number, so the height it implies is arithmetic
119
+ * the slot does — and these are the two measurements it needs, flattened once here
120
+ * rather than in every text area on the screen.
121
+ */
122
+ textArea: {
123
+ lineHeight: number;
124
+ paddingVertical: number;
125
+ };
126
+ descriptionStyle: StyleProp<TextStyle>;
127
+ errorStyle: StyleProp<TextStyle>;
128
+ /**
129
+ * The two decorators of an `InputGroup`, already pinned to their edge and inset by the
130
+ * field's own padding. They are resolved here, on the root, because the size that
131
+ * decides that padding is the root's — the group itself adds no axis of its own.
132
+ */
133
+ prefixStyle: StyleProp<ViewStyle>;
134
+ suffixStyle: StyleProp<ViewStyle>;
135
+ /**
136
+ * Values, not a style: an icon is a third party's component, and `size` and `color` are
137
+ * props it takes rather than a style it accepts. Flattened once here, the way the `Chip`
138
+ * and the `Alert` publish theirs.
139
+ */
140
+ icon: {
141
+ size: number | undefined;
142
+ color: string | undefined;
143
+ };
144
+ /**
145
+ * A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
146
+ * flattens its placeholder slot once here rather than in the field.
147
+ */
148
+ placeholderTextColor?: string;
149
+ /**
150
+ * The focus state lives on the **root**, because the root's recipe resolves on it (R5)
151
+ * and it needs the value before it renders — but the node that hears the event is
152
+ * `Input.Field`, three levels down. These are how it reports back. Their identity is
153
+ * stable, so publishing them costs no re-render of a memoized slot.
154
+ */
155
+ onFieldFocus: (event: FieldFocusEvent) => void;
156
+ onFieldBlur: (event: FieldBlurEvent) => void;
157
+ /**
158
+ * The id the label carries and the field points at, so a screen reader reads "Courriel,
159
+ * champ de saisie" rather than just the placeholder.
160
+ */
161
+ labelId: string;
162
+ descriptionId: string;
163
+ isDisabled: boolean;
164
+ isInvalid: boolean;
165
+ };
166
+
167
+ export type { InputFieldProps as I, InputProps as a, InputContextValue as b, InputDescriptionProps as c, InputErrorProps as d, InputLabelPlacement as e, InputLabelProps as f, InputSize as g, InputSlot as h, InputVariant as i };
@@ -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 };
@@ -2,11 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ var _chunkXQFAUDR2cjs = require('../chunk-XQFAUDR2.cjs');
5
6
 
6
7
 
8
+ var _chunkF6CQ6CBIcjs = require('../chunk-F6CQ6CBI.cjs');
7
9
 
8
10
 
9
11
 
12
+ var _chunkTGZZ3RZUcjs = require('../chunk-TGZZ3RZU.cjs');
10
13
 
11
14
 
12
15
 
@@ -16,8 +19,6 @@
16
19
 
17
20
 
18
21
 
19
- var _chunkV63JO65Fcjs = require('../chunk-V63JO65F.cjs');
20
- require('../chunk-3QBT3Q65.cjs');
21
22
 
22
23
 
23
24
 
@@ -30,10 +31,66 @@ require('../chunk-3QBT3Q65.cjs');
30
31
 
31
32
 
32
33
 
34
+ var _chunkGPVNCJ3Zcjs = require('../chunk-GPVNCJ3Z.cjs');
35
+ require('../chunk-7DPL3ZDS.cjs');
33
36
 
34
37
 
35
38
 
36
39
 
40
+ var _chunkWR7YLDVVcjs = require('../chunk-WR7YLDVV.cjs');
41
+ require('../chunk-EJQCQPET.cjs');
37
42
 
38
43
 
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;
44
+
45
+ var _chunkFNEUOBCVcjs = require('../chunk-FNEUOBCV.cjs');
46
+ require('../chunk-57SJ4LJF.cjs');
47
+
48
+
49
+
50
+
51
+
52
+ var _chunkZP2E2H2Gcjs = require('../chunk-ZP2E2H2G.cjs');
53
+
54
+
55
+
56
+ var _chunkGLGU2WFLcjs = require('../chunk-GLGU2WFL.cjs');
57
+ require('../chunk-MC7SY2QH.cjs');
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
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
+ exports.CloseButton = _chunkTGZZ3RZUcjs.CloseButton; exports.FEEDBACK_OVERLAY = _chunkGPVNCJ3Zcjs.FEEDBACK_OVERLAY; exports.HIGHLIGHT_DURATION = _chunkGPVNCJ3Zcjs.HIGHLIGHT_DURATION; exports.HIGHLIGHT_OPACITY = _chunkGPVNCJ3Zcjs.HIGHLIGHT_OPACITY; exports.Icon = _chunkWR7YLDVVcjs.Icon; exports.IconContext = _chunkWR7YLDVVcjs.IconContext; exports.PRESS_DURATION = _chunkGPVNCJ3Zcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunkGPVNCJ3Zcjs.PRESS_SCALE; exports.Portal = _chunkXQFAUDR2cjs.Portal; exports.PortalContext = _chunkXQFAUDR2cjs.PortalContext; exports.PortalHost = _chunkXQFAUDR2cjs.PortalHost; exports.PressableFeedback = _chunkGPVNCJ3Zcjs.PressableFeedback; exports.RIPPLE_CONFIRM_DURATION = _chunkGPVNCJ3Zcjs.RIPPLE_CONFIRM_DURATION; exports.RIPPLE_EXPAND_DURATION = _chunkGPVNCJ3Zcjs.RIPPLE_EXPAND_DURATION; exports.RIPPLE_FADE_IN = _chunkGPVNCJ3Zcjs.RIPPLE_FADE_IN; exports.RIPPLE_FADE_OUT = _chunkGPVNCJ3Zcjs.RIPPLE_FADE_OUT; exports.RIPPLE_FADE_OUT_DELAY = _chunkGPVNCJ3Zcjs.RIPPLE_FADE_OUT_DELAY; exports.RIPPLE_OPACITY = _chunkGPVNCJ3Zcjs.RIPPLE_OPACITY; exports.RIPPLE_START_SCALE = _chunkGPVNCJ3Zcjs.RIPPLE_START_SCALE; exports.SCALE_REFERENCE_WIDTH = _chunkGPVNCJ3Zcjs.SCALE_REFERENCE_WIDTH; exports.SelectionFill = _chunkF6CQ6CBIcjs.SelectionFill; exports.Slot = _chunkZP2E2H2Gcjs.Slot; exports.childrenToString = _chunkZP2E2H2Gcjs.childrenToString; exports.closeButtonBase = _chunkTGZZ3RZUcjs.closeButtonBase; exports.createRecipe = _chunkFNEUOBCVcjs.createRecipe; exports.createSlotContext = _chunkZP2E2H2Gcjs.createSlotContext; exports.markOverlay = _chunkGPVNCJ3Zcjs.markOverlay; exports.mergeProps = _chunkZP2E2H2Gcjs.mergeProps; exports.mergeRefs = _chunkGLGU2WFLcjs.mergeRefs; exports.pressScaleFor = _chunkGPVNCJ3Zcjs.pressScaleFor; exports.radiusAxis = _chunkFNEUOBCVcjs.radiusAxis; exports.resolveAnimation = _chunkGPVNCJ3Zcjs.resolveAnimation; exports.resolveSlotAnimation = _chunkGPVNCJ3Zcjs.resolveSlotAnimation; exports.rippleRadiusFor = _chunkGPVNCJ3Zcjs.rippleRadiusFor; exports.useFeedback = _chunkGPVNCJ3Zcjs.useFeedback; exports.useIconContext = _chunkWR7YLDVVcjs.useIconContext; exports.useStyleProps = _chunkGLGU2WFLcjs.useStyleProps;