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

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 (53) hide show
  1. package/dist/chunk-2WMVDMFV.cjs +62 -0
  2. package/dist/chunk-33QILJJH.cjs +143 -0
  3. package/dist/chunk-4EPS7UBO.js +496 -0
  4. package/dist/{chunk-M7P46XKI.cjs → chunk-57SJ4LJF.cjs} +33 -3
  5. package/dist/chunk-6ARON3XT.cjs +534 -0
  6. package/dist/{chunk-RBNCR5KB.js → chunk-A3EGFI6T.js} +31 -1
  7. package/dist/chunk-A4VD4MHK.cjs +757 -0
  8. package/dist/{chunk-NHPQQQ7P.cjs → chunk-BHTFIZTQ.cjs} +55 -88
  9. package/dist/chunk-EVXZGNPA.cjs +303 -0
  10. package/dist/chunk-EXX6ATAS.js +303 -0
  11. package/dist/chunk-GGW42MY4.js +20 -0
  12. package/dist/chunk-JXLRHKCQ.js +143 -0
  13. package/dist/chunk-MC7SY2QH.cjs +20 -0
  14. package/dist/{chunk-PBVPOX7D.js → chunk-MWXE7D4L.js} +29 -62
  15. package/dist/{chunk-RCP3SD26.js → chunk-N7C4UNUL.js} +2 -126
  16. package/dist/chunk-RMLFMRWL.js +102 -0
  17. package/dist/chunk-UBA6AEY6.cjs +102 -0
  18. package/dist/{chunk-B755PRVJ.cjs → chunk-UVO4GFSW.cjs} +3 -127
  19. package/dist/chunk-WXAME7KB.js +728 -0
  20. package/dist/chunk-XHZBXYVU.js +62 -0
  21. package/dist/components/button/index.cjs +15 -0
  22. package/dist/components/button/index.d.cts +658 -0
  23. package/dist/components/button/index.d.ts +658 -0
  24. package/dist/components/button/index.js +15 -0
  25. package/dist/components/typography/index.cjs +14 -0
  26. package/dist/components/typography/index.d.cts +116 -0
  27. package/dist/components/typography/index.d.ts +116 -0
  28. package/dist/components/typography/index.js +14 -0
  29. package/dist/components/view/index.cjs +16 -0
  30. package/dist/components/view/index.d.cts +152 -0
  31. package/dist/components/view/index.d.ts +152 -0
  32. package/dist/components/view/index.js +16 -0
  33. package/dist/create-recipe-C0XXjuow.d.cts +89 -0
  34. package/dist/create-recipe-CPXFo2rk.d.ts +89 -0
  35. package/dist/index.cjs +151 -5
  36. package/dist/index.d.cts +77 -4
  37. package/dist/index.d.ts +77 -4
  38. package/dist/index.js +155 -9
  39. package/dist/pressable-feedback.type-1K8YEOb8.d.cts +195 -0
  40. package/dist/pressable-feedback.type-BwkKLQlX.d.ts +195 -0
  41. package/dist/style-props.type-B1BG5TCm.d.cts +31 -0
  42. package/dist/style-props.type-B1BG5TCm.d.ts +31 -0
  43. package/dist/system/index.cjs +64 -3
  44. package/dist/system/index.d.cts +299 -75
  45. package/dist/system/index.d.ts +299 -75
  46. package/dist/system/index.js +66 -5
  47. package/dist/theme/index.cjs +4 -3
  48. package/dist/theme/index.d.cts +26 -14
  49. package/dist/theme/index.d.ts +26 -14
  50. package/dist/theme/index.js +7 -6
  51. package/dist/{theme.type-B3ODSLbB.d.cts → theme.type-C2gNHpEx.d.cts} +8 -2
  52. package/dist/{theme.type-B3ODSLbB.d.ts → theme.type-C2gNHpEx.d.ts} +8 -2
  53. package/package.json +64 -18
@@ -0,0 +1,195 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { ImageSourcePropType, StyleProp, ImageStyle, PressableProps, ViewStyle } from 'react-native';
3
+ import { I as ImageStyleProps, V as ViewStyleProps } from './style-props.type-B1BG5TCm.js';
4
+ import { SharedValue } from 'react-native-reanimated';
5
+
6
+ /**
7
+ * The props Lucide, Ionicons and `react-native-vector-icons` all accept — the shape
8
+ * `as` is handed. It is a convention rather than an interface anyone published, which is
9
+ * exactly why `Icon` exists: without it every call site computes the two values by hand.
10
+ */
11
+ type IconComponentProps = {
12
+ size?: number;
13
+ color?: string;
14
+ };
15
+ /** What every form takes, and the only lever the two non-rendering ones have. */
16
+ type IconBase = {
17
+ /** Overrides what the surrounding slot asked for. */
18
+ size?: number;
19
+ /** A raw value (R7), never a token. Overrides the slot's. */
20
+ color?: string;
21
+ };
22
+ /**
23
+ * An icon component — `size` and `color` are injected into it.
24
+ *
25
+ * No style props and no `style`: we do not render this node, the third party does, and
26
+ * there is no published interface that says it would accept either. Wrapping it in a view
27
+ * to make them work would add a level of depth to every icon in the library.
28
+ */
29
+ type IconAsProps = IconBase & {
30
+ as: ComponentType<IconComponentProps>;
31
+ children?: never;
32
+ source?: never;
33
+ };
34
+ /**
35
+ * A raw `react-native-svg` element, cloned with the resolved size and colour.
36
+ *
37
+ * No style props and no `style` either: the node is the caller's own element, and they can
38
+ * style it where they wrote it.
39
+ */
40
+ type IconChildrenProps = IconBase & {
41
+ as?: never;
42
+ children: ReactNode;
43
+ source?: never;
44
+ };
45
+ /**
46
+ * An image, tinted with the resolved colour — **the one form that carries R14**, because
47
+ * it is the one where we render the node.
48
+ */
49
+ type IconSourceProps = IconBase & ImageStyleProps & {
50
+ as?: never;
51
+ children?: never;
52
+ source: ImageSourcePropType;
53
+ style?: StyleProp<ImageStyle>;
54
+ };
55
+ /**
56
+ * Three forms, and the type says which one you are in.
57
+ *
58
+ * The union is what makes R14's boundary checkable rather than merely documented. When
59
+ * every form declared the style props, `<Icon as={Trash2} marginEnd={8} />` compiled and
60
+ * did nothing at all — the prop was dropped on the two forms that do not render the node,
61
+ * silently, and only a comment said so. Now it is a compile error that points at `size`
62
+ * and `color`, which are the levers those forms actually have.
63
+ *
64
+ * It also makes the three mutually exclusive, which they always were at runtime: `as`
65
+ * wins over children, and children over `source`.
66
+ */
67
+ type IconProps = IconAsProps | IconChildrenProps | IconSourceProps;
68
+ /** What a component root publishes so the icons inside it need no props at all. */
69
+ type IconContextValue = {
70
+ size?: number;
71
+ color?: string;
72
+ };
73
+
74
+ type AnimationConfig = {
75
+ scale?: boolean;
76
+ highlight?: boolean;
77
+ ripple?: boolean;
78
+ };
79
+ /**
80
+ * `false` and `'disabled'` turn this component's animations off. `'disable-all'` turns
81
+ * them off for its descendants too — a long list kills every row's worklets with one
82
+ * prop instead of threading it down. An object switches them off one at a time.
83
+ */
84
+ type AnimationProp = boolean | 'disabled' | 'disable-all' | AnimationConfig;
85
+ /** `animation` once normalised — what the components actually read. */
86
+ type ResolvedAnimation = {
87
+ scale: boolean;
88
+ highlight: boolean;
89
+ ripple: boolean;
90
+ /** True when every sub-animation is off: the branch that mounts no worklet at all. */
91
+ none: boolean;
92
+ /** Propagated to descendants through context. */
93
+ disableAll: boolean;
94
+ };
95
+ /**
96
+ * R14 — it renders a `Pressable`, so it takes that node's style keys as props. The
97
+ * primitive every pressable component in the library is built on cannot be the one place
98
+ * where `padding={16}` has to become an object again.
99
+ */
100
+ type PressableFeedbackProps = Omit<PressableProps, 'style' | 'children' | 'disabled'> & ViewStyleProps & {
101
+ /** Controlled: the root owns the state, because its recipe resolves on it (R5). */
102
+ isPressed?: boolean;
103
+ /** R8: `disabled` is not part of the public vocabulary, `isX` is. */
104
+ isDisabled?: boolean;
105
+ /**
106
+ * Merge into the single child instead of rendering a pressable (R12) — **keeping the
107
+ * feedback**. Swapping this component out for a bare `Slot` would silently drop the
108
+ * touch feedback of every `asChild` control.
109
+ */
110
+ asChild?: boolean;
111
+ animation?: AnimationProp;
112
+ style?: StyleProp<ViewStyle>;
113
+ /**
114
+ * The overlays are children, not a prop — `<PressableFeedback.Highlight />` or
115
+ * `<PressableFeedback.Ripple />`, in any order: the root paints them under everything
116
+ * else wherever they sit. The scale is the root's own and needs nothing rendered.
117
+ *
118
+ * `Pressable`'s function form is dropped on purpose. It exists to hand the press state
119
+ * to children; here the root above already owns that state and this publishes it
120
+ * through context, so the function form would be a second, quieter source of truth.
121
+ */
122
+ children?: ReactNode;
123
+ };
124
+ /**
125
+ * A slot's own animation, overriding the blanket one on the root. `false` switches that
126
+ * slot off; the object tunes it. Deliberately two knobs rather than a full timing
127
+ * surface — anything past this is a different animation, and that is a component's job,
128
+ * not a prop's.
129
+ */
130
+ type SlotAnimation = boolean | {
131
+ /** Milliseconds. Falls back to the shared press timing. */
132
+ duration?: number;
133
+ /** How far the overlay goes at full press, 0 to 1. */
134
+ opacity?: number;
135
+ };
136
+ /** One ripple wave. Two of them, so a rapid double tap does not cut the one in flight. */
137
+ type RippleWave = {
138
+ /** `0 → 1` as the circle opens. */
139
+ expand: SharedValue<number>;
140
+ /** `0 → 1` as the ink arrives, on its own curve. */
141
+ alpha: SharedValue<number>;
142
+ /** Where the finger landed, in the root's coordinates. */
143
+ origin: SharedValue<{
144
+ x: number;
145
+ y: number;
146
+ }>;
147
+ };
148
+ /**
149
+ * The corner keys an overlay copies off the root. The `Left`/`Right` forms are absent
150
+ * rather than forgotten: R13 bans them, because RN mirrors only the logical ones under RTL.
151
+ */
152
+ type RadiusStyle = Pick<ViewStyle, 'borderRadius' | 'borderStartStartRadius' | 'borderStartEndRadius' | 'borderEndStartRadius' | 'borderEndEndRadius'>;
153
+ type FeedbackContext = {
154
+ /**
155
+ * The overlay's ink, resolved by the root from its own background.
156
+ *
157
+ * A wash or a wave has to contrast with what it sits on, and only the root knows that —
158
+ * it flattens its own `style` and reads `backgroundColor`, then takes the contrasting
159
+ * side the same way a tint does. Black ink at 10% on a saturated fill is close to
160
+ * invisible, which is the one thing a press indicator cannot be.
161
+ */
162
+ ink: string;
163
+ /**
164
+ * The root's own corners, so an overlay rounds itself to match. `corners` and not
165
+ * `radius`: the ripple already has a radius, and it is a length in points rather than a
166
+ * shape.
167
+ *
168
+ * An absolute fill has square corners and every control here is rounded, so without this
169
+ * both the wash and the wave paint outside the surface at each corner. The overlay
170
+ * carries the clip rather than the root: clipping the root would also cut a child that
171
+ * legitimately overflows — a badge on a button's corner — and that child has nothing to
172
+ * do with the press.
173
+ */
174
+ corners: RadiusStyle;
175
+ isPressed: boolean;
176
+ animation: ResolvedAnimation;
177
+ /** Absent on the static branch, where nothing animates and no worklet is mounted. */
178
+ progress?: SharedValue<number>;
179
+ /** How big the root is — what the scale coefficient is computed from. */
180
+ size?: SharedValue<{
181
+ width: number;
182
+ height: number;
183
+ }>;
184
+ /**
185
+ * The two ripple waves, driven by the **root**.
186
+ *
187
+ * They belong to the root because the root is the touch surface. An overlay carrying its
188
+ * own handlers only hears touches that land on *it* — and it is a sibling of the label,
189
+ * not its parent, so pressing the text of a button would do nothing. Touches bubble to
190
+ * the `Pressable`, which is why the handlers live there and the waves are published down.
191
+ */
192
+ waves?: readonly [RippleWave, RippleWave];
193
+ };
194
+
195
+ export type { AnimationConfig as A, FeedbackContext as F, IconComponentProps as I, PressableFeedbackProps as P, RadiusStyle as R, SlotAnimation as S, IconContextValue as a, IconProps as b, AnimationProp as c, ResolvedAnimation as d, RippleWave as e };
@@ -0,0 +1,31 @@
1
+ import { ImageStyle, TextStyle, ViewStyle } 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 { ImageStyle, TextStyle, ViewStyle } 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,10 @@
2
2
 
3
3
 
4
4
 
5
+ var _chunk2WMVDMFVcjs = require('../chunk-2WMVDMFV.cjs');
5
6
 
6
7
 
7
8
 
8
- var _chunkB755PRVJcjs = require('../chunk-B755PRVJ.cjs');
9
- require('../chunk-M7P46XKI.cjs');
10
9
 
11
10
 
12
11
 
@@ -14,4 +13,66 @@ require('../chunk-M7P46XKI.cjs');
14
13
 
15
14
 
16
15
 
17
- exports.Slot = _chunkB755PRVJcjs.Slot; exports.childrenToString = _chunkB755PRVJcjs.childrenToString; exports.createRecipe = _chunkB755PRVJcjs.createRecipe; exports.createSlotContext = _chunkB755PRVJcjs.createSlotContext; exports.mergeProps = _chunkB755PRVJcjs.mergeProps; exports.mergeRefs = _chunkB755PRVJcjs.mergeRefs;
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ var _chunkA4VD4MHKcjs = require('../chunk-A4VD4MHK.cjs');
31
+
32
+
33
+ var _chunkUVO4GFSWcjs = require('../chunk-UVO4GFSW.cjs');
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ var _chunkEVXZGNPAcjs = require('../chunk-EVXZGNPA.cjs');
42
+ require('../chunk-57SJ4LJF.cjs');
43
+ require('../chunk-MC7SY2QH.cjs');
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ exports.FEEDBACK_OVERLAY = _chunkA4VD4MHKcjs.FEEDBACK_OVERLAY; exports.HIGHLIGHT_DURATION = _chunkA4VD4MHKcjs.HIGHLIGHT_DURATION; exports.HIGHLIGHT_OPACITY = _chunkA4VD4MHKcjs.HIGHLIGHT_OPACITY; exports.Icon = _chunkA4VD4MHKcjs.Icon; exports.IconContext = _chunkA4VD4MHKcjs.IconContext; exports.PRESS_DURATION = _chunkA4VD4MHKcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunkA4VD4MHKcjs.PRESS_SCALE; exports.Portal = _chunk2WMVDMFVcjs.Portal; exports.PortalContext = _chunk2WMVDMFVcjs.PortalContext; exports.PortalHost = _chunk2WMVDMFVcjs.PortalHost; exports.PressableFeedback = _chunkA4VD4MHKcjs.PressableFeedback; exports.RIPPLE_CONFIRM_DURATION = _chunkA4VD4MHKcjs.RIPPLE_CONFIRM_DURATION; exports.RIPPLE_EXPAND_DURATION = _chunkA4VD4MHKcjs.RIPPLE_EXPAND_DURATION; exports.RIPPLE_FADE_IN = _chunkA4VD4MHKcjs.RIPPLE_FADE_IN; exports.RIPPLE_FADE_OUT = _chunkA4VD4MHKcjs.RIPPLE_FADE_OUT; exports.RIPPLE_FADE_OUT_DELAY = _chunkA4VD4MHKcjs.RIPPLE_FADE_OUT_DELAY; exports.RIPPLE_OPACITY = _chunkA4VD4MHKcjs.RIPPLE_OPACITY; exports.RIPPLE_START_SCALE = _chunkA4VD4MHKcjs.RIPPLE_START_SCALE; exports.SCALE_REFERENCE_WIDTH = _chunkA4VD4MHKcjs.SCALE_REFERENCE_WIDTH; exports.Slot = _chunkEVXZGNPAcjs.Slot; exports.childrenToString = _chunkEVXZGNPAcjs.childrenToString; exports.createRecipe = _chunkUVO4GFSWcjs.createRecipe; exports.createSlotContext = _chunkEVXZGNPAcjs.createSlotContext; exports.markOverlay = _chunkA4VD4MHKcjs.markOverlay; exports.mergeProps = _chunkEVXZGNPAcjs.mergeProps; exports.mergeRefs = _chunkEVXZGNPAcjs.mergeRefs; exports.pressScaleFor = _chunkA4VD4MHKcjs.pressScaleFor; exports.resolveAnimation = _chunkA4VD4MHKcjs.resolveAnimation; exports.resolveSlotAnimation = _chunkA4VD4MHKcjs.resolveSlotAnimation; exports.rippleRadiusFor = _chunkA4VD4MHKcjs.rippleRadiusFor; exports.useFeedback = _chunkA4VD4MHKcjs.useFeedback; exports.useIconContext = _chunkA4VD4MHKcjs.useIconContext; exports.useStyleProps = _chunkEVXZGNPAcjs.useStyleProps;