@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,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextField,
|
|
3
|
+
TextFieldDescription,
|
|
4
|
+
TextFieldError,
|
|
5
|
+
TextFieldField,
|
|
6
|
+
TextFieldLabel,
|
|
7
|
+
TextFieldRoot,
|
|
8
|
+
textFieldRecipe,
|
|
9
|
+
useTextField
|
|
10
|
+
} from "../../chunk-2NRZKJG7.js";
|
|
11
|
+
import "../../chunk-4GTAZM2C.js";
|
|
12
|
+
import "../../chunk-A3EGFI6T.js";
|
|
13
|
+
import "../../chunk-K72UDPVN.js";
|
|
14
|
+
import "../../chunk-36PRYGAM.js";
|
|
15
|
+
import "../../chunk-M63GFNKV.js";
|
|
16
|
+
export {
|
|
17
|
+
TextField,
|
|
18
|
+
TextFieldDescription,
|
|
19
|
+
TextFieldError,
|
|
20
|
+
TextFieldField,
|
|
21
|
+
TextFieldLabel,
|
|
22
|
+
TextFieldRoot,
|
|
23
|
+
textFieldRecipe,
|
|
24
|
+
useTextField
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkAMCSSOJTcjs = require('../../chunk-AMCSSOJT.cjs');
|
|
6
|
+
require('../../chunk-FNEUOBCV.cjs');
|
|
7
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
8
|
+
require('../../chunk-7GHM4GKL.cjs');
|
|
9
|
+
require('../../chunk-H4E4HDEP.cjs');
|
|
10
|
+
require('../../chunk-TK44VBIE.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.TextSpan = _chunkAMCSSOJTcjs.TextSpan; exports.Typography = _chunkAMCSSOJTcjs.Typography; exports.typographyRecipe = _chunkAMCSSOJTcjs.typographyRecipe;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as react_native from 'react-native';
|
|
2
|
+
import { TextProps, StyleProp, TextStyle, Text } from 'react-native';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
import { X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
|
|
7
|
+
import { R as Recipe } from '../../create-recipe-dC7wMfnj.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The ten roles, aligned with HeroUI Native's `text` — six headings, three body steps and
|
|
11
|
+
* inline code. Each one fixes **size, line height, weight and family together**, which is
|
|
12
|
+
* what removes the separate `size` and `weight` props the legacy component carried, and
|
|
13
|
+
* with them the illegal combinations they allowed: a heading in `weight="light"`, a
|
|
14
|
+
* caption in `lg`.
|
|
15
|
+
*
|
|
16
|
+
* `h1`–`h6` name a level, not an HTML tag — React Native has no document outline, so the
|
|
17
|
+
* number is the step on the scale and nothing more. Announcing a heading to a screen
|
|
18
|
+
* reader stays explicit: `accessibilityRole="header"`.
|
|
19
|
+
*/
|
|
20
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'body-sm' | 'body-xs' | 'code';
|
|
21
|
+
type TypographySlot = 'root';
|
|
22
|
+
type TypographyOwnProps = {
|
|
23
|
+
/** The role. It fixes size, line height, weight and family at once. */
|
|
24
|
+
variant?: TypographyVariant;
|
|
25
|
+
/**
|
|
26
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). In a text component there is only one
|
|
27
|
+
* thing to tint, so it lands on the text itself.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
/** R12 — the child element becomes the text node, keeping this variant's style. */
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
style?: StyleProp<TextStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* R14 — the role's own vocabulary, then every `TextStyle` key it does not already claim.
|
|
37
|
+
* `color` is the component's, so it keeps its R7 meaning here rather than becoming the
|
|
38
|
+
* style key of the same name; `fontSize` and `fontWeight` stay available, which is how a
|
|
39
|
+
* one-off deviation is written without inventing a prop for it.
|
|
40
|
+
*/
|
|
41
|
+
type TypographyProps = Omit<TextProps, 'style'> & TypographyOwnProps & Omit<TextStyleProps, keyof TypographyOwnProps | keyof TextProps>;
|
|
42
|
+
type TextSpanOwnProps = {
|
|
43
|
+
/** R12 — the child element becomes the span. */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
style?: StyleProp<TextStyle>;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
type TextSpanProps = Omit<TextProps, 'style'> & TextSpanOwnProps & Omit<TextStyleProps, keyof TextSpanOwnProps | keyof TextProps>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Text, by the role it plays.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Typography variant="heading-lg">Projets</Typography>
|
|
55
|
+
* <Typography>Trois en cours, un archivé.</Typography>
|
|
56
|
+
* <Typography variant="caption">Mis à jour il y a deux minutes</Typography>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* **One node, and no slots.** A paragraph is a `Text`; there is nothing inside it for the
|
|
60
|
+
* component to publish. Styling a fragment of it is `TextSpan`'s job, not a slot of this
|
|
61
|
+
* one — React Native already makes a nested `Text` inherit from its parent, so a span
|
|
62
|
+
* needs no context, no resolved style and nothing from here. This component would only be
|
|
63
|
+
* duplicating a mechanism the platform ships.
|
|
64
|
+
*
|
|
65
|
+
* **The role fixes size, line height, weight and family together**, which is why there is
|
|
66
|
+
* no `size` and no `weight` prop: those axes are not free to combine. A one-off deviation
|
|
67
|
+
* is a style prop — `fontSize={17}` — said plainly rather than dressed as vocabulary.
|
|
68
|
+
*
|
|
69
|
+
* Alignment likewise has no prop of its own: `textAlign` is a `TextStyle` key, so R14
|
|
70
|
+
* already exposes it, and the caller writes the value React Native understands instead of
|
|
71
|
+
* a translation layer this component would have to keep honest.
|
|
72
|
+
*/
|
|
73
|
+
declare const Typography: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
74
|
+
variant?: TypographyVariant;
|
|
75
|
+
color?: string;
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
78
|
+
children?: react.ReactNode;
|
|
79
|
+
} & Omit<TextStyleProps, "color" | "pointerEvents" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "disabled" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "variant" | "asChild" | "pressRetentionOffset" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A fragment of text, styled apart from the text around it.
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <Typography>
|
|
86
|
+
* Supprimer <TextSpan fontWeight="600">trois projets</TextSpan> définitivement.
|
|
87
|
+
* </Typography>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* **It is a bare React Native `Text`, and that is the whole design.** Nesting a `Text`
|
|
91
|
+
* inside a `Text` already inherits the parent's font, size, weight and colour on both
|
|
92
|
+
* platforms — so a span needs no context to read, no role to resolve and no provider
|
|
93
|
+
* above it. The legacy component published a `TextSpanContext` to carry that inheritance
|
|
94
|
+
* by hand; it was reimplementing the platform, and it is gone.
|
|
95
|
+
*
|
|
96
|
+
* What is left is R14 and nothing else: every `TextStyle` key as a prop, and `style` after
|
|
97
|
+
* them. There is no `variant` here on purpose — a span that names a role would be a
|
|
98
|
+
* `Typography`, and nesting one of those is how you change role mid-sentence.
|
|
99
|
+
*/
|
|
100
|
+
declare const TextSpan: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
103
|
+
children?: react.ReactNode;
|
|
104
|
+
} & Omit<TextStyleProps, "pointerEvents" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "disabled" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "asChild" | "pressRetentionOffset" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
105
|
+
|
|
106
|
+
/** Every role produces the same one slot, so the recipe's style functions share a shape. */
|
|
107
|
+
type StyleFn = (theme: XAUITheme) => Record<TypographySlot, TextStyle>;
|
|
108
|
+
/**
|
|
109
|
+
* There is no `base`. A text node's defaults are React Native's own, and restating them
|
|
110
|
+
* here would only give them a second place to drift from.
|
|
111
|
+
*/
|
|
112
|
+
declare const typographyRecipe: Recipe<"root", TypographyVariant, {
|
|
113
|
+
readonly variant: Record<TypographyVariant, StyleFn>;
|
|
114
|
+
}>;
|
|
115
|
+
|
|
116
|
+
export { TextSpan, type TextSpanProps, Typography, type TypographyProps, type TypographySlot, type TypographyVariant, typographyRecipe };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as react_native from 'react-native';
|
|
2
|
+
import { TextProps, StyleProp, TextStyle, Text } from 'react-native';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
6
|
+
import { X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
7
|
+
import { R as Recipe } from '../../create-recipe-BdVd2ffi.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The ten roles, aligned with HeroUI Native's `text` — six headings, three body steps and
|
|
11
|
+
* inline code. Each one fixes **size, line height, weight and family together**, which is
|
|
12
|
+
* what removes the separate `size` and `weight` props the legacy component carried, and
|
|
13
|
+
* with them the illegal combinations they allowed: a heading in `weight="light"`, a
|
|
14
|
+
* caption in `lg`.
|
|
15
|
+
*
|
|
16
|
+
* `h1`–`h6` name a level, not an HTML tag — React Native has no document outline, so the
|
|
17
|
+
* number is the step on the scale and nothing more. Announcing a heading to a screen
|
|
18
|
+
* reader stays explicit: `accessibilityRole="header"`.
|
|
19
|
+
*/
|
|
20
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'body-sm' | 'body-xs' | 'code';
|
|
21
|
+
type TypographySlot = 'root';
|
|
22
|
+
type TypographyOwnProps = {
|
|
23
|
+
/** The role. It fixes size, line height, weight and family at once. */
|
|
24
|
+
variant?: TypographyVariant;
|
|
25
|
+
/**
|
|
26
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). In a text component there is only one
|
|
27
|
+
* thing to tint, so it lands on the text itself.
|
|
28
|
+
*/
|
|
29
|
+
color?: string;
|
|
30
|
+
/** R12 — the child element becomes the text node, keeping this variant's style. */
|
|
31
|
+
asChild?: boolean;
|
|
32
|
+
style?: StyleProp<TextStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* R14 — the role's own vocabulary, then every `TextStyle` key it does not already claim.
|
|
37
|
+
* `color` is the component's, so it keeps its R7 meaning here rather than becoming the
|
|
38
|
+
* style key of the same name; `fontSize` and `fontWeight` stay available, which is how a
|
|
39
|
+
* one-off deviation is written without inventing a prop for it.
|
|
40
|
+
*/
|
|
41
|
+
type TypographyProps = Omit<TextProps, 'style'> & TypographyOwnProps & Omit<TextStyleProps, keyof TypographyOwnProps | keyof TextProps>;
|
|
42
|
+
type TextSpanOwnProps = {
|
|
43
|
+
/** R12 — the child element becomes the span. */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
style?: StyleProp<TextStyle>;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
type TextSpanProps = Omit<TextProps, 'style'> & TextSpanOwnProps & Omit<TextStyleProps, keyof TextSpanOwnProps | keyof TextProps>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Text, by the role it plays.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Typography variant="heading-lg">Projets</Typography>
|
|
55
|
+
* <Typography>Trois en cours, un archivé.</Typography>
|
|
56
|
+
* <Typography variant="caption">Mis à jour il y a deux minutes</Typography>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* **One node, and no slots.** A paragraph is a `Text`; there is nothing inside it for the
|
|
60
|
+
* component to publish. Styling a fragment of it is `TextSpan`'s job, not a slot of this
|
|
61
|
+
* one — React Native already makes a nested `Text` inherit from its parent, so a span
|
|
62
|
+
* needs no context, no resolved style and nothing from here. This component would only be
|
|
63
|
+
* duplicating a mechanism the platform ships.
|
|
64
|
+
*
|
|
65
|
+
* **The role fixes size, line height, weight and family together**, which is why there is
|
|
66
|
+
* no `size` and no `weight` prop: those axes are not free to combine. A one-off deviation
|
|
67
|
+
* is a style prop — `fontSize={17}` — said plainly rather than dressed as vocabulary.
|
|
68
|
+
*
|
|
69
|
+
* Alignment likewise has no prop of its own: `textAlign` is a `TextStyle` key, so R14
|
|
70
|
+
* already exposes it, and the caller writes the value React Native understands instead of
|
|
71
|
+
* a translation layer this component would have to keep honest.
|
|
72
|
+
*/
|
|
73
|
+
declare const Typography: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
74
|
+
variant?: TypographyVariant;
|
|
75
|
+
color?: string;
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
78
|
+
children?: react.ReactNode;
|
|
79
|
+
} & Omit<TextStyleProps, "color" | "pointerEvents" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "disabled" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "variant" | "asChild" | "pressRetentionOffset" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A fragment of text, styled apart from the text around it.
|
|
83
|
+
*
|
|
84
|
+
* ```tsx
|
|
85
|
+
* <Typography>
|
|
86
|
+
* Supprimer <TextSpan fontWeight="600">trois projets</TextSpan> définitivement.
|
|
87
|
+
* </Typography>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* **It is a bare React Native `Text`, and that is the whole design.** Nesting a `Text`
|
|
91
|
+
* inside a `Text` already inherits the parent's font, size, weight and colour on both
|
|
92
|
+
* platforms — so a span needs no context to read, no role to resolve and no provider
|
|
93
|
+
* above it. The legacy component published a `TextSpanContext` to carry that inheritance
|
|
94
|
+
* by hand; it was reimplementing the platform, and it is gone.
|
|
95
|
+
*
|
|
96
|
+
* What is left is R14 and nothing else: every `TextStyle` key as a prop, and `style` after
|
|
97
|
+
* them. There is no `variant` here on purpose — a span that names a role would be a
|
|
98
|
+
* `Typography`, and nesting one of those is how you change role mid-sentence.
|
|
99
|
+
*/
|
|
100
|
+
declare const TextSpan: react.ForwardRefExoticComponent<Omit<react_native.TextProps, "style"> & {
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
style?: react_native.StyleProp<react_native.TextStyle>;
|
|
103
|
+
children?: react.ReactNode;
|
|
104
|
+
} & Omit<TextStyleProps, "pointerEvents" | "style" | "children" | "id" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "disabled" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "asChild" | "pressRetentionOffset" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onTextLayout" | "maxFontSizeMultiplier" | "minimumFontScale" | "adjustsFontSizeToFit" | "dynamicTypeRamp" | "suppressHighlighting" | "lineBreakStrategyIOS" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency"> & react.RefAttributes<Text>>;
|
|
105
|
+
|
|
106
|
+
/** Every role produces the same one slot, so the recipe's style functions share a shape. */
|
|
107
|
+
type StyleFn = (theme: XAUITheme) => Record<TypographySlot, TextStyle>;
|
|
108
|
+
/**
|
|
109
|
+
* There is no `base`. A text node's defaults are React Native's own, and restating them
|
|
110
|
+
* here would only give them a second place to drift from.
|
|
111
|
+
*/
|
|
112
|
+
declare const typographyRecipe: Recipe<"root", TypographyVariant, {
|
|
113
|
+
readonly variant: Record<TypographyVariant, StyleFn>;
|
|
114
|
+
}>;
|
|
115
|
+
|
|
116
|
+
export { TextSpan, type TextSpanProps, Typography, type TypographyProps, type TypographySlot, type TypographyVariant, typographyRecipe };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextSpan,
|
|
3
|
+
Typography,
|
|
4
|
+
typographyRecipe
|
|
5
|
+
} from "../../chunk-73RKQC5X.js";
|
|
6
|
+
import "../../chunk-4GTAZM2C.js";
|
|
7
|
+
import "../../chunk-A3EGFI6T.js";
|
|
8
|
+
import "../../chunk-K72UDPVN.js";
|
|
9
|
+
import "../../chunk-36PRYGAM.js";
|
|
10
|
+
import "../../chunk-M63GFNKV.js";
|
|
11
|
+
export {
|
|
12
|
+
TextSpan,
|
|
13
|
+
Typography,
|
|
14
|
+
typographyRecipe
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkTDTUAIFFcjs = require('../../chunk-TDTUAIFF.cjs');
|
|
8
|
+
require('../../chunk-7GHM4GKL.cjs');
|
|
9
|
+
require('../../chunk-H4E4HDEP.cjs');
|
|
10
|
+
require('../../chunk-TK44VBIE.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.Column = _chunkTDTUAIFFcjs.Column; exports.Grid = _chunkTDTUAIFFcjs.Grid; exports.Row = _chunkTDTUAIFFcjs.Row; exports.Stack = _chunkTDTUAIFFcjs.Stack; exports.useGrid = _chunkTDTUAIFFcjs.useGrid;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as react_native from 'react-native';
|
|
2
|
+
import { View, ViewProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { V as ViewStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A horizontal axis.
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Row gap={8} alignItems="center">
|
|
12
|
+
* <Button.Icon as={Trash2} />
|
|
13
|
+
* <Typography variant="h6">Supprimer</Typography>
|
|
14
|
+
* </Row>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* **It contributes one declaration**, `flexDirection: 'row'`, and everything else it looks
|
|
18
|
+
* like it offers comes from R14: `gap`, `alignItems`, `justifyContent`, `padding` and the
|
|
19
|
+
* rest are `ViewStyle` keys every node already exposes as props. That is deliberate — the
|
|
20
|
+
* legacy component invented `mainAxisAlignment`, `crossAxisAlignment` and `mainAxisSize`,
|
|
21
|
+
* a vocabulary to learn for saying what React Native already says.
|
|
22
|
+
*
|
|
23
|
+
* There is no `reversed` prop either. `row` already flips in an RTL layout, which is the
|
|
24
|
+
* case that matters, and a genuine reversal is `style={{ flexDirection: 'row-reverse' }}`.
|
|
25
|
+
*/
|
|
26
|
+
declare const Row: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
29
|
+
children?: react.ReactNode;
|
|
30
|
+
} & Omit<ViewStyleProps, "flexDirection" | "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "asChild"> & react.RefAttributes<View>>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A vertical axis.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Column gap={16} padding={16}>
|
|
37
|
+
* <Typography variant="h3">Projets</Typography>
|
|
38
|
+
* <Typography variant="body-sm">Trois en cours, un archivé.</Typography>
|
|
39
|
+
* </Column>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* **It contributes one declaration**, `flexDirection: 'column'` — which is React Native's
|
|
43
|
+
* default, so this component exists for what it *says* rather than for what it changes.
|
|
44
|
+
* A column written as a column reads as a deliberate axis, and its siblings in a layout
|
|
45
|
+
* are then all named the same way; a bare `View` leaves the reader to infer it.
|
|
46
|
+
*
|
|
47
|
+
* Everything else comes from R14: `gap`, `alignItems`, `justifyContent`, `padding` are
|
|
48
|
+
* `ViewStyle` keys every node already exposes as props, under React Native's own names.
|
|
49
|
+
*/
|
|
50
|
+
declare const Column: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
51
|
+
asChild?: boolean;
|
|
52
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
53
|
+
children?: react.ReactNode;
|
|
54
|
+
} & Omit<ViewStyleProps, "flexDirection" | "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "asChild"> & react.RefAttributes<View>>;
|
|
55
|
+
|
|
56
|
+
type GridContextValue = {
|
|
57
|
+
/**
|
|
58
|
+
* The width of one column in points, or `undefined` on the very first render — the grid
|
|
59
|
+
* has not been measured yet. A cell falls back to a percentage for that one frame.
|
|
60
|
+
*/
|
|
61
|
+
cellWidth: number | undefined;
|
|
62
|
+
columns: number;
|
|
63
|
+
gap: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* R10 — the resolved geometry a cell needs, published by the root that measured it.
|
|
67
|
+
*
|
|
68
|
+
* Strict, and named: a `Grid.Item` outside a `Grid` has no column width to span, and
|
|
69
|
+
* failing with the component's name beats rendering a cell of arbitrary size.
|
|
70
|
+
*/
|
|
71
|
+
declare function useGrid(): GridContextValue;
|
|
72
|
+
|
|
73
|
+
type AxisOwnProps = {
|
|
74
|
+
/** R12 — the child element becomes the axis, keeping its direction. */
|
|
75
|
+
asChild?: boolean;
|
|
76
|
+
style?: StyleProp<ViewStyle>;
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Everything a `View` can be styled with, as props (R14), **minus `flexDirection`** — that
|
|
81
|
+
* one is the component's identity, and a `Row` that could be told to lay out as a column
|
|
82
|
+
* would only be a `View` with a longer name. Reversal and the rest go through `style`,
|
|
83
|
+
* which is the escape hatch for what has no readable prop.
|
|
84
|
+
*
|
|
85
|
+
* Note what is *not* declared here: no `mainAxisAlignment`, no `crossAxisAlignment`, no
|
|
86
|
+
* `gap` prop of our own. They are `justifyContent`, `alignItems` and `gap` — React
|
|
87
|
+
* Native's own names, carrying React Native's own values, and R14 already exposes every
|
|
88
|
+
* one of them. A vocabulary of ours would be a second set of words for the same thing.
|
|
89
|
+
*/
|
|
90
|
+
type AxisProps = Omit<ViewProps, 'style'> & AxisOwnProps & Omit<ViewStyleProps, keyof AxisOwnProps | keyof ViewProps | 'flexDirection'>;
|
|
91
|
+
type RowProps = AxisProps;
|
|
92
|
+
type ColumnProps = AxisProps;
|
|
93
|
+
/**
|
|
94
|
+
* `Stack` and `Stack.Item` take the full R14 set: unlike the axes, neither claims a style
|
|
95
|
+
* key as its identity. `position` is set by each of them and remains overridable, because
|
|
96
|
+
* a layer that has to be `relative` for one screen should not need a different component.
|
|
97
|
+
*/
|
|
98
|
+
type StackProps = Omit<ViewProps, 'style'> & AxisOwnProps & Omit<ViewStyleProps, keyof AxisOwnProps | keyof ViewProps>;
|
|
99
|
+
type StackItemProps = StackProps;
|
|
100
|
+
type GridOwnProps = {
|
|
101
|
+
/** How many columns. Floored, and never below one. @default 2 */
|
|
102
|
+
columns?: number;
|
|
103
|
+
/**
|
|
104
|
+
* The space between cells, in points — React Native's `gap`, taken as a prop because the
|
|
105
|
+
* root has to read it to size the columns. @default 0
|
|
106
|
+
*/
|
|
107
|
+
gap?: number;
|
|
108
|
+
style?: StyleProp<ViewStyle>;
|
|
109
|
+
children?: ReactNode;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* No `asChild`: the root measures itself through `onLayout` and publishes the result, so
|
|
113
|
+
* it has to be the node it renders. `flexDirection`, `flexWrap` and the three gap keys are
|
|
114
|
+
* withheld for the same reason — they are the grid's mechanism, not its decoration.
|
|
115
|
+
*/
|
|
116
|
+
type GridProps = Omit<ViewProps, 'style'> & GridOwnProps & Omit<ViewStyleProps, keyof GridOwnProps | keyof ViewProps | 'flexDirection' | 'flexWrap' | 'columnGap' | 'rowGap'>;
|
|
117
|
+
type GridItemOwnProps = {
|
|
118
|
+
/** How many columns the cell covers. Clamped to the grid's count. @default 1 */
|
|
119
|
+
span?: number;
|
|
120
|
+
style?: StyleProp<ViewStyle>;
|
|
121
|
+
children?: ReactNode;
|
|
122
|
+
};
|
|
123
|
+
/** `width` is the grid's answer, so it is not a prop here. */
|
|
124
|
+
type GridItemProps = Omit<ViewProps, 'style'> & GridItemOwnProps & Omit<ViewStyleProps, keyof GridItemOwnProps | keyof ViewProps | 'width'>;
|
|
125
|
+
|
|
126
|
+
/** Overlaying is composed: the root is the containing block, `Item` is a layer in it. */
|
|
127
|
+
declare const Stack: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
128
|
+
asChild?: boolean;
|
|
129
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
130
|
+
children?: react.ReactNode;
|
|
131
|
+
} & Omit<ViewStyleProps, "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "asChild"> & react.RefAttributes<react_native.View>> & {
|
|
132
|
+
Item: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
133
|
+
asChild?: boolean;
|
|
134
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
135
|
+
children?: react.ReactNode;
|
|
136
|
+
} & Omit<ViewStyleProps, "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "asChild"> & react.RefAttributes<react_native.View>>;
|
|
137
|
+
};
|
|
138
|
+
/** Every child is a cell; `Item` is the one that spans more than a column. */
|
|
139
|
+
declare const Grid: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
140
|
+
columns?: number;
|
|
141
|
+
gap?: number;
|
|
142
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
143
|
+
children?: react.ReactNode;
|
|
144
|
+
} & Omit<ViewStyleProps, "columnGap" | "flexDirection" | "flexWrap" | "gap" | "rowGap" | "pointerEvents" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "columns"> & react.RefAttributes<react_native.View>> & {
|
|
145
|
+
Item: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
|
|
146
|
+
span?: number;
|
|
147
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
148
|
+
children?: react.ReactNode;
|
|
149
|
+
} & Omit<ViewStyleProps, "width" | "pointerEvents" | "style" | "children" | "span" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction"> & react.RefAttributes<react_native.View>>;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export { type AxisProps, Column, type ColumnProps, Grid, type GridContextValue, type GridItemProps, type GridProps, Row, type RowProps, Stack, type StackItemProps, type StackProps, useGrid };
|