@xaui/native 0.9.1-alpha.24 → 0.9.1-alpha.25
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-6RO26ORT.js → chunk-2OY76YNB.js} +44 -10
- package/dist/{chunk-LIQTGAI7.cjs → chunk-BULNTP5N.cjs} +6 -7
- package/dist/chunk-GSEK6OCY.cjs +72 -0
- package/dist/{chunk-J4QE34AU.js → chunk-I6UCYAO2.js} +20 -21
- package/dist/{chunk-GBPWTFTU.cjs → chunk-OHEHPQLC.cjs} +10 -1
- package/dist/{chunk-GG2WWCBK.js → chunk-TZG3DERP.js} +10 -1
- package/dist/{chunk-P2XA4DV7.cjs → chunk-YEW5LPWL.cjs} +45 -11
- package/dist/chunk-ZDCGPK5Z.js +72 -0
- package/dist/components/input/index.cjs +12 -2
- package/dist/components/input/index.d.cts +109 -117
- package/dist/components/input/index.d.ts +109 -117
- package/dist/components/input/index.js +11 -1
- package/dist/components/input-otp/index.cjs +2 -2
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/text-area/index.cjs +13 -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 +13 -0
- package/dist/index.cjs +22 -6
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +27 -11
- package/dist/input.type-BpJeUIe8.d.cts +151 -0
- package/dist/input.type-DjyZ6P2C.d.ts +151 -0
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.js +1 -1
- package/package.json +11 -1
|
@@ -1,148 +1,140 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
2
|
import * as react_native from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { View, Text, TextInput } from 'react-native';
|
|
4
|
+
import { V as ViewStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
|
|
5
|
+
import { R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
|
|
6
|
+
import { i as InputVariant, g as InputSize, e as InputLabelPlacement, b as InputContextValue, h as InputSlot } from '../../input.type-BpJeUIe8.cjs';
|
|
7
|
+
export { c as InputDescriptionProps, d as InputErrorProps, I as InputFieldProps, f as InputLabelProps, a as InputProps } from '../../input.type-BpJeUIe8.cjs';
|
|
7
8
|
import { R as Recipe, g as SlotStyles, j as StyleFn } from '../../create-recipe-dBN_ewZc.cjs';
|
|
8
9
|
|
|
9
|
-
type InputSlot = 'root' | 'label' | 'field' | 'placeholder' | 'description' | 'error';
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
13
|
-
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
* A text field, with the label, the hint and the error that make it usable.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Input>
|
|
15
|
+
* <Input.Label>Courriel</Input.Label>
|
|
16
|
+
* <Input.Field
|
|
17
|
+
* value={email}
|
|
18
|
+
* onChangeText={setEmail}
|
|
19
|
+
* placeholder="nom@exemple.fr"
|
|
20
|
+
* keyboardType="email-address"
|
|
21
|
+
* />
|
|
22
|
+
* <Input.Description>On ne le partage jamais.</Input.Description>
|
|
23
|
+
* </Input>
|
|
17
24
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* makes.
|
|
25
|
-
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
26
|
-
* to move, so its focus shows in the caret alone.
|
|
25
|
+
* <Input isInvalid={Boolean(error)}>
|
|
26
|
+
* <Input.Label>Mot de passe</Input.Label>
|
|
27
|
+
* <Input.Field secureTextEntry value={password} onChangeText={setPassword} />
|
|
28
|
+
* {error ? <Input.Error>{error}</Input.Error> : null}
|
|
29
|
+
* </Input>
|
|
30
|
+
* ```
|
|
27
31
|
*
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
type InputVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
34
|
-
/**
|
|
35
|
-
* Where the label sits relative to the field's box.
|
|
32
|
+
* **The root is the column, not the field.** `Input.Field` is the `TextInput`, which is
|
|
33
|
+
* what makes the label, the hint and the error slots of one component rather than three
|
|
34
|
+
* components a form has to keep in step — and it is why `TextInputProps` are on the field
|
|
35
|
+
* rather than on the root.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
40
|
-
*
|
|
41
|
-
* Because the inside label positions itself against the top of the root, it assumes the
|
|
42
|
-
* field is the first thing in the column's flow: write `Input.Description` and
|
|
43
|
-
* `Input.Error` after the field, which is where they belong anyway.
|
|
37
|
+
* There is no auto-wrap here (R3): a string child of an input is not a label, a value or
|
|
38
|
+
* a placeholder in any way the component could guess.
|
|
44
39
|
*/
|
|
45
|
-
|
|
46
|
-
type InputSize = Size;
|
|
47
|
-
/**
|
|
48
|
-
* What the `Input` itself understands. R14 — a name in here is the component's, so the
|
|
49
|
-
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
50
|
-
* `ViewStyle`'s, and `color` is R7's tint.
|
|
51
|
-
*/
|
|
52
|
-
type InputOwnProps = {
|
|
40
|
+
declare const InputRoot: react.ForwardRefExoticComponent<{
|
|
53
41
|
variant?: InputVariant;
|
|
54
|
-
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
55
42
|
size?: InputSize;
|
|
56
|
-
/** Overrides the `field` radius the theme chose for every size. */
|
|
57
43
|
radius?: RadiusKey;
|
|
58
|
-
/** Above the box, or lifted into it. @default 'outside' */
|
|
59
44
|
labelPlacement?: InputLabelPlacement;
|
|
60
|
-
/**
|
|
61
|
-
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
62
|
-
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
63
|
-
* colour is a role like any other, it is also what the field borders on focus.
|
|
64
|
-
*/
|
|
65
45
|
color?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
68
|
-
* treatment off: an error outranks focus, and a field that is both should read as
|
|
69
|
-
* wrong rather than as busy.
|
|
70
|
-
*
|
|
71
|
-
* It does **not** mount or unmount `Input.Error`. That stays the caller's — a slot that
|
|
72
|
-
* silently renders nothing is a slot you cannot debug.
|
|
73
|
-
*/
|
|
74
46
|
isInvalid?: boolean;
|
|
75
|
-
/** Dims the field and makes it uneditable. */
|
|
76
47
|
isDisabled?: boolean;
|
|
77
|
-
style?: StyleProp<ViewStyle>;
|
|
78
|
-
children?: ReactNode;
|
|
79
|
-
}
|
|
48
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
49
|
+
children?: react.ReactNode;
|
|
50
|
+
} & Omit<react_native.ViewProps, keyof {
|
|
51
|
+
variant?: InputVariant;
|
|
52
|
+
size?: InputSize;
|
|
53
|
+
radius?: RadiusKey;
|
|
54
|
+
labelPlacement?: InputLabelPlacement;
|
|
55
|
+
color?: string;
|
|
56
|
+
isInvalid?: boolean;
|
|
57
|
+
isDisabled?: boolean;
|
|
58
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
59
|
+
children?: react.ReactNode;
|
|
60
|
+
}> & Omit<ViewStyleProps, "color" | "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" | "isDisabled" | "radius" | "size" | "variant" | "labelPlacement" | "isInvalid"> & {
|
|
61
|
+
asChild?: boolean;
|
|
62
|
+
} & react.RefAttributes<View>>;
|
|
63
|
+
|
|
80
64
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
65
|
+
* The hint under the field — the format expected, what the value is used for.
|
|
66
|
+
*
|
|
67
|
+
* It carries the id the field points at with `aria-describedby`, so it is read after the
|
|
68
|
+
* label rather than skipped. It turns `danger` with `isInvalid`, like the label.
|
|
69
|
+
*
|
|
70
|
+
* It sits inset by half the field's padding, so the column reads as one block rather than
|
|
71
|
+
* as a label, a box and a stray line.
|
|
84
72
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
declare const InputDescription: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
74
|
+
children?: react.ReactNode;
|
|
75
|
+
} & react.RefAttributes<Text>>;
|
|
76
|
+
|
|
89
77
|
/**
|
|
90
|
-
*
|
|
78
|
+
* What is wrong with the value, in `danger`.
|
|
79
|
+
*
|
|
80
|
+
* **It always renders what it is given.** `isInvalid` paints the border, the label and the
|
|
81
|
+
* description; it does not mount or unmount this slot, because a slot that silently
|
|
82
|
+
* renders nothing is a slot you cannot debug — you write the condition yourself and see
|
|
83
|
+
* it:
|
|
84
|
+
*
|
|
85
|
+
* ```tsx
|
|
86
|
+
* <Input isInvalid={Boolean(error)}>
|
|
87
|
+
* <Input.Field value={value} onChangeText={onChange} />
|
|
88
|
+
* {error ? <Input.Error>{error}</Input.Error> : null}
|
|
89
|
+
* </Input>
|
|
90
|
+
* ```
|
|
91
91
|
*
|
|
92
|
-
* `
|
|
93
|
-
*
|
|
92
|
+
* `accessibilityLiveRegion` is deliberately not set: an error that appears while you are
|
|
93
|
+
* still typing in the field is announced by the field's own `aria-invalid`, and a live
|
|
94
|
+
* region on top of that reads the message on every keystroke that changes it.
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
type InputLabelProps = InputTextProps;
|
|
101
|
-
type InputDescriptionProps = InputTextProps;
|
|
102
|
-
type InputErrorProps = InputTextProps;
|
|
96
|
+
declare const InputError: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
97
|
+
children?: react.ReactNode;
|
|
98
|
+
} & react.RefAttributes<Text>>;
|
|
99
|
+
|
|
103
100
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
101
|
+
* The `TextInput` itself — the one node of this component that the user types into.
|
|
102
|
+
*
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <Input.Field value={email} onChangeText={setEmail} placeholder="nom@exemple.fr" />
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* It takes everything `TextInput` takes, which is why `value`, `defaultValue`, `onChange`,
|
|
108
|
+
* `keyboardType`, `secureTextEntry`, `autoComplete` and `multiline` are written here and
|
|
109
|
+
* not on the root. There is no `type`: that is an HTML prop, and React Native splits it
|
|
110
|
+
* into `inputMode`, `keyboardType`, `secureTextEntry` and `autoComplete`.
|
|
111
|
+
*
|
|
112
|
+
* What it does *not* take is `editable`: that is `disabled` under another name, and R8
|
|
113
|
+
* keeps it off the public surface — `isDisabled` on the root is what stops the field.
|
|
114
|
+
*
|
|
115
|
+
* It reports focus up rather than styling it (R5): the root's recipe resolves on the
|
|
116
|
+
* focus state, so the root owns it and this composes the caller's handlers into the two
|
|
117
|
+
* the context published.
|
|
107
118
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
declare const InputField: react.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "editable"> & Omit<TextStyleProps, keyof react_native.TextInputProps> & react.RefAttributes<TextInput>>;
|
|
120
|
+
|
|
110
121
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
122
|
+
* What the field is for. It turns `danger` with `isInvalid`, so the field that is wrong is
|
|
123
|
+
* findable on a long form without reading every message.
|
|
124
|
+
*
|
|
125
|
+
* It carries the id the field points at, which is what makes a screen reader announce
|
|
126
|
+
* "Courriel, champ de saisie" instead of reading the placeholder and hoping.
|
|
127
|
+
*
|
|
128
|
+
* Its colour comes from the theme's `foreground` rather than the variant's: the label sits
|
|
129
|
+
* outside the box, on the screen behind it, so a tinted field does not tint it.
|
|
114
130
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
descriptionStyle: StyleProp<TextStyle>;
|
|
119
|
-
errorStyle: StyleProp<TextStyle>;
|
|
120
|
-
/**
|
|
121
|
-
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
122
|
-
* flattens its placeholder slot once here rather than in the field.
|
|
123
|
-
*/
|
|
124
|
-
placeholderTextColor?: string;
|
|
125
|
-
/**
|
|
126
|
-
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
127
|
-
* and it needs the value before it renders — but the node that hears the event is
|
|
128
|
-
* `Input.Field`, three levels down. These are how it reports back. Their identity is
|
|
129
|
-
* stable, so publishing them costs no re-render of a memoized slot.
|
|
130
|
-
*/
|
|
131
|
-
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
132
|
-
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
133
|
-
/**
|
|
134
|
-
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
135
|
-
* champ de saisie" rather than just the placeholder.
|
|
136
|
-
*/
|
|
137
|
-
labelId: string;
|
|
138
|
-
descriptionId: string;
|
|
139
|
-
isDisabled: boolean;
|
|
140
|
-
isInvalid: boolean;
|
|
141
|
-
};
|
|
131
|
+
declare const InputLabel: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
132
|
+
children?: react.ReactNode;
|
|
133
|
+
} & react.RefAttributes<Text>>;
|
|
142
134
|
|
|
143
135
|
declare const useInput: () => InputContextValue;
|
|
144
136
|
|
|
145
|
-
declare const inputRecipe: Recipe<"label" | "field" | "description" | "root" | "placeholder" | "error", InputVariant, {
|
|
137
|
+
declare const inputRecipe: Recipe<"label" | "field" | "description" | "root" | "textArea" | "placeholder" | "error", InputVariant, {
|
|
146
138
|
readonly size: {
|
|
147
139
|
readonly xs: (theme: XAUITheme) => SlotStyles<InputSlot>;
|
|
148
140
|
readonly sm: (theme: XAUITheme) => SlotStyles<InputSlot>;
|
|
@@ -210,4 +202,4 @@ declare const Input: react.ForwardRefExoticComponent<{
|
|
|
210
202
|
} & react.RefAttributes<react_native.Text>>;
|
|
211
203
|
};
|
|
212
204
|
|
|
213
|
-
export { Input,
|
|
205
|
+
export { Input, InputContextValue, InputDescription, InputError, InputField, InputLabel, InputLabelPlacement, InputRoot, InputSize, InputSlot, InputVariant, inputRecipe, useInput };
|
|
@@ -1,148 +1,140 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
2
|
import * as react_native from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { View, Text, TextInput } from 'react-native';
|
|
4
|
+
import { V as ViewStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.js';
|
|
5
|
+
import { R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
|
|
6
|
+
import { i as InputVariant, g as InputSize, e as InputLabelPlacement, b as InputContextValue, h as InputSlot } from '../../input.type-DjyZ6P2C.js';
|
|
7
|
+
export { c as InputDescriptionProps, d as InputErrorProps, I as InputFieldProps, f as InputLabelProps, a as InputProps } from '../../input.type-DjyZ6P2C.js';
|
|
7
8
|
import { R as Recipe, g as SlotStyles, j as StyleFn } from '../../create-recipe-C4JkINrA.js';
|
|
8
9
|
|
|
9
|
-
type InputSlot = 'root' | 'label' | 'field' | 'placeholder' | 'description' | 'error';
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
13
|
-
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
* A text field, with the label, the hint and the error that make it usable.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Input>
|
|
15
|
+
* <Input.Label>Courriel</Input.Label>
|
|
16
|
+
* <Input.Field
|
|
17
|
+
* value={email}
|
|
18
|
+
* onChangeText={setEmail}
|
|
19
|
+
* placeholder="nom@exemple.fr"
|
|
20
|
+
* keyboardType="email-address"
|
|
21
|
+
* />
|
|
22
|
+
* <Input.Description>On ne le partage jamais.</Input.Description>
|
|
23
|
+
* </Input>
|
|
17
24
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* makes.
|
|
25
|
-
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
26
|
-
* to move, so its focus shows in the caret alone.
|
|
25
|
+
* <Input isInvalid={Boolean(error)}>
|
|
26
|
+
* <Input.Label>Mot de passe</Input.Label>
|
|
27
|
+
* <Input.Field secureTextEntry value={password} onChangeText={setPassword} />
|
|
28
|
+
* {error ? <Input.Error>{error}</Input.Error> : null}
|
|
29
|
+
* </Input>
|
|
30
|
+
* ```
|
|
27
31
|
*
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
type InputVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
34
|
-
/**
|
|
35
|
-
* Where the label sits relative to the field's box.
|
|
32
|
+
* **The root is the column, not the field.** `Input.Field` is the `TextInput`, which is
|
|
33
|
+
* what makes the label, the hint and the error slots of one component rather than three
|
|
34
|
+
* components a form has to keep in step — and it is why `TextInputProps` are on the field
|
|
35
|
+
* rather than on the root.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
40
|
-
*
|
|
41
|
-
* Because the inside label positions itself against the top of the root, it assumes the
|
|
42
|
-
* field is the first thing in the column's flow: write `Input.Description` and
|
|
43
|
-
* `Input.Error` after the field, which is where they belong anyway.
|
|
37
|
+
* There is no auto-wrap here (R3): a string child of an input is not a label, a value or
|
|
38
|
+
* a placeholder in any way the component could guess.
|
|
44
39
|
*/
|
|
45
|
-
|
|
46
|
-
type InputSize = Size;
|
|
47
|
-
/**
|
|
48
|
-
* What the `Input` itself understands. R14 — a name in here is the component's, so the
|
|
49
|
-
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
50
|
-
* `ViewStyle`'s, and `color` is R7's tint.
|
|
51
|
-
*/
|
|
52
|
-
type InputOwnProps = {
|
|
40
|
+
declare const InputRoot: react.ForwardRefExoticComponent<{
|
|
53
41
|
variant?: InputVariant;
|
|
54
|
-
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
55
42
|
size?: InputSize;
|
|
56
|
-
/** Overrides the `field` radius the theme chose for every size. */
|
|
57
43
|
radius?: RadiusKey;
|
|
58
|
-
/** Above the box, or lifted into it. @default 'outside' */
|
|
59
44
|
labelPlacement?: InputLabelPlacement;
|
|
60
|
-
/**
|
|
61
|
-
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
62
|
-
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
63
|
-
* colour is a role like any other, it is also what the field borders on focus.
|
|
64
|
-
*/
|
|
65
45
|
color?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
68
|
-
* treatment off: an error outranks focus, and a field that is both should read as
|
|
69
|
-
* wrong rather than as busy.
|
|
70
|
-
*
|
|
71
|
-
* It does **not** mount or unmount `Input.Error`. That stays the caller's — a slot that
|
|
72
|
-
* silently renders nothing is a slot you cannot debug.
|
|
73
|
-
*/
|
|
74
46
|
isInvalid?: boolean;
|
|
75
|
-
/** Dims the field and makes it uneditable. */
|
|
76
47
|
isDisabled?: boolean;
|
|
77
|
-
style?: StyleProp<ViewStyle>;
|
|
78
|
-
children?: ReactNode;
|
|
79
|
-
}
|
|
48
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
49
|
+
children?: react.ReactNode;
|
|
50
|
+
} & Omit<react_native.ViewProps, keyof {
|
|
51
|
+
variant?: InputVariant;
|
|
52
|
+
size?: InputSize;
|
|
53
|
+
radius?: RadiusKey;
|
|
54
|
+
labelPlacement?: InputLabelPlacement;
|
|
55
|
+
color?: string;
|
|
56
|
+
isInvalid?: boolean;
|
|
57
|
+
isDisabled?: boolean;
|
|
58
|
+
style?: react_native.StyleProp<react_native.ViewStyle>;
|
|
59
|
+
children?: react.ReactNode;
|
|
60
|
+
}> & Omit<ViewStyleProps, "color" | "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" | "isDisabled" | "radius" | "size" | "variant" | "labelPlacement" | "isInvalid"> & {
|
|
61
|
+
asChild?: boolean;
|
|
62
|
+
} & react.RefAttributes<View>>;
|
|
63
|
+
|
|
80
64
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
65
|
+
* The hint under the field — the format expected, what the value is used for.
|
|
66
|
+
*
|
|
67
|
+
* It carries the id the field points at with `aria-describedby`, so it is read after the
|
|
68
|
+
* label rather than skipped. It turns `danger` with `isInvalid`, like the label.
|
|
69
|
+
*
|
|
70
|
+
* It sits inset by half the field's padding, so the column reads as one block rather than
|
|
71
|
+
* as a label, a box and a stray line.
|
|
84
72
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
declare const InputDescription: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
74
|
+
children?: react.ReactNode;
|
|
75
|
+
} & react.RefAttributes<Text>>;
|
|
76
|
+
|
|
89
77
|
/**
|
|
90
|
-
*
|
|
78
|
+
* What is wrong with the value, in `danger`.
|
|
79
|
+
*
|
|
80
|
+
* **It always renders what it is given.** `isInvalid` paints the border, the label and the
|
|
81
|
+
* description; it does not mount or unmount this slot, because a slot that silently
|
|
82
|
+
* renders nothing is a slot you cannot debug — you write the condition yourself and see
|
|
83
|
+
* it:
|
|
84
|
+
*
|
|
85
|
+
* ```tsx
|
|
86
|
+
* <Input isInvalid={Boolean(error)}>
|
|
87
|
+
* <Input.Field value={value} onChangeText={onChange} />
|
|
88
|
+
* {error ? <Input.Error>{error}</Input.Error> : null}
|
|
89
|
+
* </Input>
|
|
90
|
+
* ```
|
|
91
91
|
*
|
|
92
|
-
* `
|
|
93
|
-
*
|
|
92
|
+
* `accessibilityLiveRegion` is deliberately not set: an error that appears while you are
|
|
93
|
+
* still typing in the field is announced by the field's own `aria-invalid`, and a live
|
|
94
|
+
* region on top of that reads the message on every keystroke that changes it.
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
type InputLabelProps = InputTextProps;
|
|
101
|
-
type InputDescriptionProps = InputTextProps;
|
|
102
|
-
type InputErrorProps = InputTextProps;
|
|
96
|
+
declare const InputError: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
97
|
+
children?: react.ReactNode;
|
|
98
|
+
} & react.RefAttributes<Text>>;
|
|
99
|
+
|
|
103
100
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
101
|
+
* The `TextInput` itself — the one node of this component that the user types into.
|
|
102
|
+
*
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <Input.Field value={email} onChangeText={setEmail} placeholder="nom@exemple.fr" />
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* It takes everything `TextInput` takes, which is why `value`, `defaultValue`, `onChange`,
|
|
108
|
+
* `keyboardType`, `secureTextEntry`, `autoComplete` and `multiline` are written here and
|
|
109
|
+
* not on the root. There is no `type`: that is an HTML prop, and React Native splits it
|
|
110
|
+
* into `inputMode`, `keyboardType`, `secureTextEntry` and `autoComplete`.
|
|
111
|
+
*
|
|
112
|
+
* What it does *not* take is `editable`: that is `disabled` under another name, and R8
|
|
113
|
+
* keeps it off the public surface — `isDisabled` on the root is what stops the field.
|
|
114
|
+
*
|
|
115
|
+
* It reports focus up rather than styling it (R5): the root's recipe resolves on the
|
|
116
|
+
* focus state, so the root owns it and this composes the caller's handlers into the two
|
|
117
|
+
* the context published.
|
|
107
118
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
declare const InputField: react.ForwardRefExoticComponent<Omit<react_native.TextInputProps, "editable"> & Omit<TextStyleProps, keyof react_native.TextInputProps> & react.RefAttributes<TextInput>>;
|
|
120
|
+
|
|
110
121
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
122
|
+
* What the field is for. It turns `danger` with `isInvalid`, so the field that is wrong is
|
|
123
|
+
* findable on a long form without reading every message.
|
|
124
|
+
*
|
|
125
|
+
* It carries the id the field points at, which is what makes a screen reader announce
|
|
126
|
+
* "Courriel, champ de saisie" instead of reading the placeholder and hoping.
|
|
127
|
+
*
|
|
128
|
+
* Its colour comes from the theme's `foreground` rather than the variant's: the label sits
|
|
129
|
+
* outside the box, on the screen behind it, so a tinted field does not tint it.
|
|
114
130
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
descriptionStyle: StyleProp<TextStyle>;
|
|
119
|
-
errorStyle: StyleProp<TextStyle>;
|
|
120
|
-
/**
|
|
121
|
-
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
122
|
-
* flattens its placeholder slot once here rather than in the field.
|
|
123
|
-
*/
|
|
124
|
-
placeholderTextColor?: string;
|
|
125
|
-
/**
|
|
126
|
-
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
127
|
-
* and it needs the value before it renders — but the node that hears the event is
|
|
128
|
-
* `Input.Field`, three levels down. These are how it reports back. Their identity is
|
|
129
|
-
* stable, so publishing them costs no re-render of a memoized slot.
|
|
130
|
-
*/
|
|
131
|
-
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
132
|
-
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
133
|
-
/**
|
|
134
|
-
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
135
|
-
* champ de saisie" rather than just the placeholder.
|
|
136
|
-
*/
|
|
137
|
-
labelId: string;
|
|
138
|
-
descriptionId: string;
|
|
139
|
-
isDisabled: boolean;
|
|
140
|
-
isInvalid: boolean;
|
|
141
|
-
};
|
|
131
|
+
declare const InputLabel: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
|
|
132
|
+
children?: react.ReactNode;
|
|
133
|
+
} & react.RefAttributes<Text>>;
|
|
142
134
|
|
|
143
135
|
declare const useInput: () => InputContextValue;
|
|
144
136
|
|
|
145
|
-
declare const inputRecipe: Recipe<"label" | "field" | "description" | "root" | "placeholder" | "error", InputVariant, {
|
|
137
|
+
declare const inputRecipe: Recipe<"label" | "field" | "description" | "root" | "textArea" | "placeholder" | "error", InputVariant, {
|
|
146
138
|
readonly size: {
|
|
147
139
|
readonly xs: (theme: XAUITheme) => SlotStyles<InputSlot>;
|
|
148
140
|
readonly sm: (theme: XAUITheme) => SlotStyles<InputSlot>;
|
|
@@ -210,4 +202,4 @@ declare const Input: react.ForwardRefExoticComponent<{
|
|
|
210
202
|
} & react.RefAttributes<react_native.Text>>;
|
|
211
203
|
};
|
|
212
204
|
|
|
213
|
-
export { Input,
|
|
205
|
+
export { Input, InputContextValue, InputDescription, InputError, InputField, InputLabel, InputLabelPlacement, InputRoot, InputSize, InputSlot, InputVariant, inputRecipe, useInput };
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Input,
|
|
3
|
+
InputDescription,
|
|
4
|
+
InputError,
|
|
5
|
+
InputField,
|
|
6
|
+
InputLabel,
|
|
7
|
+
InputRoot,
|
|
3
8
|
inputRecipe,
|
|
4
9
|
useInput
|
|
5
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-2OY76YNB.js";
|
|
6
11
|
import "../../chunk-3JATAB7S.js";
|
|
7
12
|
import "../../chunk-PMO62QK4.js";
|
|
8
13
|
import "../../chunk-A3EGFI6T.js";
|
|
9
14
|
import "../../chunk-GGW42MY4.js";
|
|
10
15
|
export {
|
|
11
16
|
Input,
|
|
17
|
+
InputDescription,
|
|
18
|
+
InputError,
|
|
19
|
+
InputField,
|
|
20
|
+
InputLabel,
|
|
21
|
+
InputRoot,
|
|
12
22
|
inputRecipe,
|
|
13
23
|
useInput
|
|
14
24
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkBULNTP5Ncjs = require('../../chunk-BULNTP5N.cjs');
|
|
12
12
|
require('../../chunk-EJQCQPET.cjs');
|
|
13
13
|
require('../../chunk-YXVKQMCK.cjs');
|
|
14
14
|
require('../../chunk-HUZ4AUM2.cjs');
|
|
@@ -24,4 +24,4 @@ require('../../chunk-MC7SY2QH.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.InputOTP =
|
|
27
|
+
exports.InputOTP = _chunkBULNTP5Ncjs.InputOTP; exports.OTP_ALPHANUMERIC = _chunkBULNTP5Ncjs.OTP_ALPHANUMERIC; exports.OTP_DIGITS = _chunkBULNTP5Ncjs.OTP_DIGITS; exports.OTP_LETTERS = _chunkBULNTP5Ncjs.OTP_LETTERS; exports.buildSlots = _chunkBULNTP5Ncjs.buildSlots; exports.extractPastedCode = _chunkBULNTP5Ncjs.extractPastedCode; exports.inputOTPRecipe = _chunkBULNTP5Ncjs.inputOTPRecipe; exports.useInputOTP = _chunkBULNTP5Ncjs.useInputOTP; exports.useInputOTPBox = _chunkBULNTP5Ncjs.useInputOTPBox;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkGSEK6OCYcjs = require('../../chunk-GSEK6OCY.cjs');
|
|
5
|
+
require('../../chunk-YEW5LPWL.cjs');
|
|
6
|
+
require('../../chunk-YXVKQMCK.cjs');
|
|
7
|
+
require('../../chunk-HUZ4AUM2.cjs');
|
|
8
|
+
require('../../chunk-57SJ4LJF.cjs');
|
|
9
|
+
require('../../chunk-MC7SY2QH.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.TextArea = _chunkGSEK6OCYcjs.TextArea; exports.useTextArea = _chunkGSEK6OCYcjs.useTextArea;
|