@xaui/native 0.9.1-alpha.23 → 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-E3LXUXE7.js → chunk-2OY76YNB.js} +47 -13
- package/dist/{chunk-KM2TI5IC.js → chunk-4HELPMAK.js} +76 -82
- package/dist/{chunk-AHL33YAO.js → chunk-4J26FA6O.js} +9 -7
- package/dist/{chunk-BNWS26PX.cjs → chunk-6FBGCF5T.cjs} +9 -7
- package/dist/{chunk-ZQ3JSWRO.js → chunk-A4RGJBP2.js} +4 -2
- package/dist/{chunk-I6PE5UUH.cjs → chunk-AV5LMFS3.cjs} +13 -11
- package/dist/{chunk-OGC4RKE3.js → chunk-AXSJPWSJ.js} +5 -5
- package/dist/chunk-BULNTP5N.cjs +620 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/{chunk-VDRRD6GM.cjs → chunk-EWBBDVTM.cjs} +22 -21
- package/dist/chunk-GSEK6OCY.cjs +72 -0
- package/dist/chunk-I6UCYAO2.js +731 -0
- package/dist/{chunk-BH5DSJVX.cjs → chunk-IG4Q3WQO.cjs} +61 -68
- package/dist/{chunk-6WW4CSPY.cjs → chunk-J2JJLKLG.cjs} +6 -4
- package/dist/{chunk-4MHJOWM4.cjs → chunk-J4JFIC4W.cjs} +7 -7
- package/dist/{chunk-FNQF4KQV.js → chunk-MRYLLKML.js} +18 -17
- package/dist/{chunk-GBPWTFTU.cjs → chunk-OHEHPQLC.cjs} +10 -1
- package/dist/{chunk-GG2WWCBK.js → chunk-TZG3DERP.js} +10 -1
- package/dist/{chunk-TIP3T7JJ.cjs → chunk-YEW5LPWL.cjs} +47 -13
- package/dist/chunk-ZDCGPK5Z.js +72 -0
- package/dist/{chunk-FTCTTBLG.js → chunk-ZTA47PO5.js} +7 -5
- package/dist/components/alert/index.cjs +7 -6
- package/dist/components/alert/index.js +6 -5
- package/dist/components/button/index.cjs +6 -5
- package/dist/components/button/index.js +5 -4
- package/dist/components/card/index.cjs +5 -4
- package/dist/components/card/index.js +4 -3
- package/dist/components/chip/index.cjs +7 -6
- package/dist/components/chip/index.js +6 -5
- package/dist/components/input/index.cjs +13 -3
- package/dist/components/input/index.d.cts +109 -117
- package/dist/components/input/index.d.ts +109 -117
- package/dist/components/input/index.js +12 -2
- package/dist/components/input-otp/index.cjs +27 -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 +27 -0
- 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/components/typography/index.cjs +3 -3
- package/dist/components/typography/index.js +2 -2
- package/dist/index.cjs +53 -51
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +69 -67
- package/dist/input.type-BpJeUIe8.d.cts +151 -0
- package/dist/input.type-DjyZ6P2C.d.ts +151 -0
- package/dist/system/index.cjs +6 -5
- package/dist/system/index.js +5 -4
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.js +1 -1
- package/package.json +21 -1
- package/dist/{chunk-DXGQ43IV.cjs → chunk-B4W2XNBP.cjs} +2 -2
- package/dist/{chunk-2U6JR7BF.js → chunk-G52TQJBI.js} +3 -3
- package/dist/{chunk-FVP5FUVS.js → chunk-ICR42HHG.js} +3 -3
- package/dist/{chunk-RAWOJ3N3.cjs → chunk-Y7U6ACMB.cjs} +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkY7U6ACMBcjs = require('./chunk-Y7U6ACMB.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkIBEX4XGVcjs = require('./chunk-IBEX4XGV.cjs');
|
|
13
|
+
|
|
2
14
|
|
|
3
15
|
|
|
4
16
|
|
|
@@ -14,38 +26,38 @@ var _chunk6HXWQ5AUcjs = require('./chunk-6HXWQ5AU.cjs');
|
|
|
14
26
|
|
|
15
27
|
|
|
16
28
|
|
|
17
|
-
var
|
|
29
|
+
var _chunkOHEHPQLCcjs = require('./chunk-OHEHPQLC.cjs');
|
|
18
30
|
|
|
19
31
|
|
|
20
32
|
|
|
21
33
|
|
|
22
|
-
var
|
|
34
|
+
var _chunkJ4JFIC4Wcjs = require('./chunk-J4JFIC4W.cjs');
|
|
23
35
|
|
|
24
36
|
|
|
25
37
|
|
|
26
38
|
|
|
27
|
-
var
|
|
39
|
+
var _chunkEWBBDVTMcjs = require('./chunk-EWBBDVTM.cjs');
|
|
28
40
|
|
|
29
41
|
|
|
30
42
|
|
|
31
43
|
|
|
32
44
|
|
|
33
45
|
|
|
34
|
-
var
|
|
46
|
+
var _chunk6FBGCF5Tcjs = require('./chunk-6FBGCF5T.cjs');
|
|
35
47
|
|
|
36
48
|
|
|
37
49
|
|
|
38
50
|
|
|
39
|
-
var
|
|
51
|
+
var _chunkAV5LMFS3cjs = require('./chunk-AV5LMFS3.cjs');
|
|
40
52
|
|
|
41
53
|
|
|
42
54
|
|
|
43
|
-
var
|
|
55
|
+
var _chunkJ2JJLKLGcjs = require('./chunk-J2JJLKLG.cjs');
|
|
44
56
|
|
|
45
57
|
|
|
46
58
|
|
|
47
59
|
|
|
48
|
-
var
|
|
60
|
+
var _chunkB4W2XNBPcjs = require('./chunk-B4W2XNBP.cjs');
|
|
49
61
|
|
|
50
62
|
|
|
51
63
|
|
|
@@ -68,36 +80,38 @@ var _chunkDXGQ43IVcjs = require('./chunk-DXGQ43IV.cjs');
|
|
|
68
80
|
|
|
69
81
|
|
|
70
82
|
|
|
83
|
+
var _chunkIG4Q3WQOcjs = require('./chunk-IG4Q3WQO.cjs');
|
|
71
84
|
|
|
72
|
-
var _chunkBH5DSJVXcjs = require('./chunk-BH5DSJVX.cjs');
|
|
73
85
|
|
|
74
86
|
|
|
75
87
|
|
|
76
88
|
|
|
77
|
-
var _chunkTIP3T7JJcjs = require('./chunk-TIP3T7JJ.cjs');
|
|
78
89
|
|
|
79
90
|
|
|
80
91
|
|
|
81
92
|
|
|
82
|
-
var _chunkRAWOJ3N3cjs = require('./chunk-RAWOJ3N3.cjs');
|
|
83
93
|
|
|
84
94
|
|
|
95
|
+
var _chunkBULNTP5Ncjs = require('./chunk-BULNTP5N.cjs');
|
|
96
|
+
require('./chunk-EJQCQPET.cjs');
|
|
85
97
|
|
|
86
|
-
var _chunkYXVKQMCKcjs = require('./chunk-YXVKQMCK.cjs');
|
|
87
98
|
|
|
88
99
|
|
|
100
|
+
var _chunkGSEK6OCYcjs = require('./chunk-GSEK6OCY.cjs');
|
|
89
101
|
|
|
90
102
|
|
|
91
103
|
|
|
92
104
|
|
|
93
|
-
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
94
105
|
|
|
95
106
|
|
|
96
107
|
|
|
97
108
|
|
|
98
109
|
|
|
110
|
+
var _chunkYEW5LPWLcjs = require('./chunk-YEW5LPWL.cjs');
|
|
111
|
+
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
|
|
114
|
+
var _chunkYXVKQMCKcjs = require('./chunk-YXVKQMCK.cjs');
|
|
101
115
|
|
|
102
116
|
|
|
103
117
|
|
|
@@ -106,45 +120,17 @@ var _chunkIBEX4XGVcjs = require('./chunk-IBEX4XGV.cjs');
|
|
|
106
120
|
|
|
107
121
|
|
|
108
122
|
var _chunkHUZ4AUM2cjs = require('./chunk-HUZ4AUM2.cjs');
|
|
109
|
-
require('./chunk-MC7SY2QH.cjs');
|
|
110
123
|
|
|
111
|
-
// src/hooks/use-controllable-state.ts
|
|
112
|
-
var _react = require('react');
|
|
113
|
-
function useControllableState({
|
|
114
|
-
value,
|
|
115
|
-
defaultValue,
|
|
116
|
-
onChange
|
|
117
|
-
}) {
|
|
118
|
-
const [uncontrolled, setUncontrolled] = _react.useState.call(void 0, defaultValue);
|
|
119
|
-
const isControlled = value !== void 0;
|
|
120
|
-
const current = isControlled ? value : uncontrolled;
|
|
121
|
-
useControlWarning(isControlled);
|
|
122
|
-
const latest = _react.useRef.call(void 0, current);
|
|
123
|
-
latest.current = current;
|
|
124
|
-
const onChangeRef = _react.useRef.call(void 0, onChange);
|
|
125
|
-
onChangeRef.current = onChange;
|
|
126
|
-
const controlled = _react.useRef.call(void 0, isControlled);
|
|
127
|
-
controlled.current = isControlled;
|
|
128
|
-
const set = _react.useCallback.call(void 0, (next) => {
|
|
129
|
-
const resolved = typeof next === "function" ? next(latest.current) : next;
|
|
130
|
-
if (resolved === latest.current) return;
|
|
131
|
-
if (!controlled.current) setUncontrolled(resolved);
|
|
132
|
-
_optionalChain([onChangeRef, 'access', _ => _.current, 'optionalCall', _2 => _2(resolved)]);
|
|
133
|
-
}, []);
|
|
134
|
-
return [current, set];
|
|
135
|
-
}
|
|
136
|
-
function useControlWarning(isControlled) {
|
|
137
|
-
const wasControlled = _react.useRef.call(void 0, isControlled);
|
|
138
|
-
if (wasControlled.current !== isControlled) {
|
|
139
|
-
_chunkBH5DSJVXcjs.warnDev.call(void 0,
|
|
140
|
-
`a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
|
|
141
|
-
);
|
|
142
|
-
wasControlled.current = isControlled;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
124
|
|
|
146
|
-
// src/hooks/use-merged-ref.ts
|
|
147
125
|
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
130
|
+
require('./chunk-MC7SY2QH.cjs');
|
|
131
|
+
|
|
132
|
+
// src/hooks/use-merged-ref.ts
|
|
133
|
+
var _react = require('react');
|
|
148
134
|
function useMergedRef(...refs) {
|
|
149
135
|
return _react.useMemo.call(void 0, () => _chunkHUZ4AUM2cjs.mergeRefs.call(void 0, ...refs), refs);
|
|
150
136
|
}
|
|
@@ -239,4 +225,20 @@ function usePrevious(value) {
|
|
|
239
225
|
|
|
240
226
|
|
|
241
227
|
|
|
242
|
-
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
exports.Alert = _chunkJ4JFIC4Wcjs.Alert; exports.Button = _chunkEWBBDVTMcjs.Button; exports.CARD_BACKGROUND = _chunk6FBGCF5Tcjs.CARD_BACKGROUND; exports.Card = _chunk6FBGCF5Tcjs.Card; exports.Chip = _chunkAV5LMFS3cjs.Chip; exports.CloseButton = _chunkJ2JJLKLGcjs.CloseButton; exports.Column = _chunkIBEX4XGVcjs.Column; exports.FEEDBACK_OVERLAY = _chunkIG4Q3WQOcjs.FEEDBACK_OVERLAY; exports.Grid = _chunkIBEX4XGVcjs.Grid; exports.HIGHLIGHT_DURATION = _chunkIG4Q3WQOcjs.HIGHLIGHT_DURATION; exports.HIGHLIGHT_OPACITY = _chunkIG4Q3WQOcjs.HIGHLIGHT_OPACITY; exports.Icon = _chunkB4W2XNBPcjs.Icon; exports.IconContext = _chunkB4W2XNBPcjs.IconContext; exports.Input = _chunkYEW5LPWLcjs.Input; exports.InputDescription = _chunkYEW5LPWLcjs.InputDescription; exports.InputError = _chunkYEW5LPWLcjs.InputError; exports.InputField = _chunkYEW5LPWLcjs.InputField; exports.InputLabel = _chunkYEW5LPWLcjs.InputLabel; exports.InputOTP = _chunkBULNTP5Ncjs.InputOTP; exports.InputRoot = _chunkYEW5LPWLcjs.InputRoot; exports.OTP_ALPHANUMERIC = _chunkBULNTP5Ncjs.OTP_ALPHANUMERIC; exports.OTP_DIGITS = _chunkBULNTP5Ncjs.OTP_DIGITS; exports.OTP_LETTERS = _chunkBULNTP5Ncjs.OTP_LETTERS; exports.PRESS_DURATION = _chunkIG4Q3WQOcjs.PRESS_DURATION; exports.PRESS_SCALE = _chunkIG4Q3WQOcjs.PRESS_SCALE; exports.Portal = _chunk6HXWQ5AUcjs.Portal; exports.PortalContext = _chunk6HXWQ5AUcjs.PortalContext; exports.PortalHost = _chunk6HXWQ5AUcjs.PortalHost; exports.PressableFeedback = _chunkIG4Q3WQOcjs.PressableFeedback; exports.RIPPLE_CONFIRM_DURATION = _chunkIG4Q3WQOcjs.RIPPLE_CONFIRM_DURATION; exports.RIPPLE_EXPAND_DURATION = _chunkIG4Q3WQOcjs.RIPPLE_EXPAND_DURATION; exports.RIPPLE_FADE_IN = _chunkIG4Q3WQOcjs.RIPPLE_FADE_IN; exports.RIPPLE_FADE_OUT = _chunkIG4Q3WQOcjs.RIPPLE_FADE_OUT; exports.RIPPLE_FADE_OUT_DELAY = _chunkIG4Q3WQOcjs.RIPPLE_FADE_OUT_DELAY; exports.RIPPLE_OPACITY = _chunkIG4Q3WQOcjs.RIPPLE_OPACITY; exports.RIPPLE_START_SCALE = _chunkIG4Q3WQOcjs.RIPPLE_START_SCALE; exports.Row = _chunkIBEX4XGVcjs.Row; exports.SCALE_REFERENCE_WIDTH = _chunkIG4Q3WQOcjs.SCALE_REFERENCE_WIDTH; exports.Slot = _chunkHUZ4AUM2cjs.Slot; exports.Stack = _chunkIBEX4XGVcjs.Stack; exports.TextArea = _chunkGSEK6OCYcjs.TextArea; exports.TextSpan = _chunkY7U6ACMBcjs.TextSpan; exports.ThemeContext = _chunk57SJ4LJFcjs.ThemeContext; exports.Typography = _chunkY7U6ACMBcjs.Typography; exports.XAUIProvider = _chunkOHEHPQLCcjs.XAUIProvider; exports.alertRecipe = _chunkJ4JFIC4Wcjs.alertRecipe; exports.buildRadius = _chunkOHEHPQLCcjs.buildRadius; exports.buildShadows = _chunkOHEHPQLCcjs.buildShadows; exports.buildSlots = _chunkBULNTP5Ncjs.buildSlots; exports.buttonRecipe = _chunkEWBBDVTMcjs.buttonRecipe; exports.cardRecipe = _chunk6FBGCF5Tcjs.cardRecipe; exports.childrenToString = _chunkHUZ4AUM2cjs.childrenToString; exports.chipRecipe = _chunkAV5LMFS3cjs.chipRecipe; exports.closeButtonBase = _chunkJ2JJLKLGcjs.closeButtonBase; exports.createRecipe = _chunkYXVKQMCKcjs.createRecipe; exports.createSlotContext = _chunkHUZ4AUM2cjs.createSlotContext; exports.createTheme = _chunkOHEHPQLCcjs.createTheme; exports.defaultTheme = _chunkOHEHPQLCcjs.defaultTheme; exports.deriveColors = _chunkOHEHPQLCcjs.deriveColors; exports.deriveTint = _chunk57SJ4LJFcjs.deriveTint; exports.extractPastedCode = _chunkBULNTP5Ncjs.extractPastedCode; exports.inputOTPRecipe = _chunkBULNTP5Ncjs.inputOTPRecipe; exports.inputRecipe = _chunkYEW5LPWLcjs.inputRecipe; exports.markBackground = _chunk6FBGCF5Tcjs.markBackground; exports.markOverlay = _chunkIG4Q3WQOcjs.markOverlay; exports.mergeProps = _chunkHUZ4AUM2cjs.mergeProps; exports.mergeRefs = _chunkHUZ4AUM2cjs.mergeRefs; exports.palette = _chunkOHEHPQLCcjs.palette; exports.pressScaleFor = _chunkIG4Q3WQOcjs.pressScaleFor; exports.primitives = _chunkOHEHPQLCcjs.primitives; exports.radiusAxis = _chunkYXVKQMCKcjs.radiusAxis; exports.resolveAnimation = _chunkIG4Q3WQOcjs.resolveAnimation; exports.resolveSlotAnimation = _chunkIG4Q3WQOcjs.resolveSlotAnimation; exports.rippleRadiusFor = _chunkIG4Q3WQOcjs.rippleRadiusFor; exports.sourceKeys = _chunkOHEHPQLCcjs.sourceKeys; exports.tokens = _chunkOHEHPQLCcjs.tokens; exports.typographyRecipe = _chunkY7U6ACMBcjs.typographyRecipe; exports.useAlert = _chunkJ4JFIC4Wcjs.useAlert; exports.useButton = _chunkEWBBDVTMcjs.useButton; exports.useCard = _chunk6FBGCF5Tcjs.useCard; exports.useChip = _chunkAV5LMFS3cjs.useChip; exports.useColorMode = _chunk57SJ4LJFcjs.useColorMode; exports.useControllableState = _chunkBULNTP5Ncjs.useControllableState; exports.useFeedback = _chunkIG4Q3WQOcjs.useFeedback; exports.useGrid = _chunkIBEX4XGVcjs.useGrid; exports.useIconContext = _chunkB4W2XNBPcjs.useIconContext; exports.useInput = _chunkYEW5LPWLcjs.useInput; exports.useInputOTP = _chunkBULNTP5Ncjs.useInputOTP; exports.useInputOTPBox = _chunkBULNTP5Ncjs.useInputOTPBox; exports.useMergedRef = useMergedRef; exports.usePressState = _chunkIG4Q3WQOcjs.usePressState; exports.usePrevious = usePrevious; exports.useStyleProps = _chunkHUZ4AUM2cjs.useStyleProps; exports.useTextArea = _chunkGSEK6OCYcjs.useTextArea; exports.useThemeColor = _chunk57SJ4LJFcjs.useThemeColor; exports.useXAUITheme = _chunk57SJ4LJFcjs.useXAUITheme;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,9 @@ export { Alert, AlertCloseProps, AlertContentProps, AlertContextValue, AlertDesc
|
|
|
2
2
|
export { Button, ButtonContextValue, ButtonIconProps, ButtonLabelProps, ButtonProps, ButtonSize, ButtonSlot, ButtonSpinnerProps, ButtonVariant, buttonRecipe, useButton } from './components/button/index.cjs';
|
|
3
3
|
export { CARD_BACKGROUND, Card, CardBackgroundProps, CardBodyProps, CardContextValue, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardSize, CardSlot, CardTitleProps, CardVariant, cardRecipe, markBackground, useCard } from './components/card/index.cjs';
|
|
4
4
|
export { Chip, ChipAvatarProps, ChipCloseProps, ChipContextValue, ChipDotProps, ChipIconProps, ChipLabelProps, ChipProps, ChipSize, ChipSlot, ChipVariant, chipRecipe, useChip } from './components/chip/index.cjs';
|
|
5
|
-
export { Input,
|
|
5
|
+
export { Input, InputDescription, InputError, InputField, InputLabel, InputRoot, inputRecipe, useInput } from './components/input/index.cjs';
|
|
6
|
+
export { InputOTP, InputOTPBoxContextValue, InputOTPBoxProps, InputOTPCaretProps, InputOTPContextValue, InputOTPGroupProps, InputOTPHandle, InputOTPPattern, InputOTPPlaceholderProps, InputOTPProps, InputOTPRenderState, InputOTPSeparatorProps, InputOTPSize, InputOTPSlot, InputOTPValueProps, InputOTPVariant, OTPSlotState, OTP_ALPHANUMERIC, OTP_DIGITS, OTP_LETTERS, buildSlots, extractPastedCode, inputOTPRecipe, useInputOTP, useInputOTPBox } from './components/input-otp/index.cjs';
|
|
7
|
+
export { TextArea, TextAreaContextValue, TextAreaFieldProps, TextAreaProps, useTextArea } from './components/text-area/index.cjs';
|
|
6
8
|
export { TextSpan, TextSpanProps, Typography, TypographyProps, TypographySlot, TypographyVariant, typographyRecipe } from './components/typography/index.cjs';
|
|
7
9
|
export { AxisProps, Column, ColumnProps, Grid, GridContextValue, GridItemProps, GridProps, Row, RowProps, Stack, StackItemProps, StackProps, useGrid } from './components/view/index.cjs';
|
|
8
10
|
import { RefCallback } from 'react';
|
|
@@ -15,6 +17,7 @@ export { A as Axes, C as CompoundVariant, R as Recipe, b as RecipeConfig, a as R
|
|
|
15
17
|
export { D as DirectionalStyleKey, I as ImageStyleProps, S as StyleProps, T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.cjs';
|
|
16
18
|
export { ColorModePreference, PaletteFamily, PaletteShade, ThemeContext, XAUIProvider, XAUIProviderProps, XAUITint, buildRadius, buildShadows, createTheme, defaultTheme, deriveColors, deriveTint, palette, primitives, sourceKeys, tokens, useColorMode, useThemeColor, useXAUITheme } from './theme/index.cjs';
|
|
17
19
|
export { C as ColorMode, F as FontSizeKey, b as FontWeightKey, R as RadiusKey, S as Size, a as XAUIColors, c as XAUIDerivedColors, d as XAUIPrimitiveColors, e as XAUIRadius, f as XAUIShadow, g as XAUISourceColors, X as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-C2gNHpEx.cjs';
|
|
20
|
+
export { b as InputContextValue, c as InputDescriptionProps, d as InputErrorProps, I as InputFieldProps, e as InputLabelPlacement, f as InputLabelProps, a as InputProps, g as InputSize, h as InputSlot, i as InputVariant } from './input.type-BpJeUIe8.cjs';
|
|
18
21
|
export { A as AnimationConfig, a as AnimationProp, F as FeedbackContext, P as PressableFeedbackProps, R as RadiusStyle, b as ResolvedAnimation, c as RippleWave, S as SlotAnimation } from './pressable-feedback.type-BA2C9sSz.cjs';
|
|
19
22
|
import 'react-native-reanimated';
|
|
20
23
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export { Alert, AlertCloseProps, AlertContentProps, AlertContextValue, AlertDesc
|
|
|
2
2
|
export { Button, ButtonContextValue, ButtonIconProps, ButtonLabelProps, ButtonProps, ButtonSize, ButtonSlot, ButtonSpinnerProps, ButtonVariant, buttonRecipe, useButton } from './components/button/index.js';
|
|
3
3
|
export { CARD_BACKGROUND, Card, CardBackgroundProps, CardBodyProps, CardContextValue, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardSize, CardSlot, CardTitleProps, CardVariant, cardRecipe, markBackground, useCard } from './components/card/index.js';
|
|
4
4
|
export { Chip, ChipAvatarProps, ChipCloseProps, ChipContextValue, ChipDotProps, ChipIconProps, ChipLabelProps, ChipProps, ChipSize, ChipSlot, ChipVariant, chipRecipe, useChip } from './components/chip/index.js';
|
|
5
|
-
export { Input,
|
|
5
|
+
export { Input, InputDescription, InputError, InputField, InputLabel, InputRoot, inputRecipe, useInput } from './components/input/index.js';
|
|
6
|
+
export { InputOTP, InputOTPBoxContextValue, InputOTPBoxProps, InputOTPCaretProps, InputOTPContextValue, InputOTPGroupProps, InputOTPHandle, InputOTPPattern, InputOTPPlaceholderProps, InputOTPProps, InputOTPRenderState, InputOTPSeparatorProps, InputOTPSize, InputOTPSlot, InputOTPValueProps, InputOTPVariant, OTPSlotState, OTP_ALPHANUMERIC, OTP_DIGITS, OTP_LETTERS, buildSlots, extractPastedCode, inputOTPRecipe, useInputOTP, useInputOTPBox } from './components/input-otp/index.js';
|
|
7
|
+
export { TextArea, TextAreaContextValue, TextAreaFieldProps, TextAreaProps, useTextArea } from './components/text-area/index.js';
|
|
6
8
|
export { TextSpan, TextSpanProps, Typography, TypographyProps, TypographySlot, TypographyVariant, typographyRecipe } from './components/typography/index.js';
|
|
7
9
|
export { AxisProps, Column, ColumnProps, Grid, GridContextValue, GridItemProps, GridProps, Row, RowProps, Stack, StackItemProps, StackProps, useGrid } from './components/view/index.js';
|
|
8
10
|
import { RefCallback } from 'react';
|
|
@@ -15,6 +17,7 @@ export { A as Axes, C as CompoundVariant, R as Recipe, b as RecipeConfig, a as R
|
|
|
15
17
|
export { D as DirectionalStyleKey, I as ImageStyleProps, S as StyleProps, T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.js';
|
|
16
18
|
export { ColorModePreference, PaletteFamily, PaletteShade, ThemeContext, XAUIProvider, XAUIProviderProps, XAUITint, buildRadius, buildShadows, createTheme, defaultTheme, deriveColors, deriveTint, palette, primitives, sourceKeys, tokens, useColorMode, useThemeColor, useXAUITheme } from './theme/index.js';
|
|
17
19
|
export { C as ColorMode, F as FontSizeKey, b as FontWeightKey, R as RadiusKey, S as Size, a as XAUIColors, c as XAUIDerivedColors, d as XAUIPrimitiveColors, e as XAUIRadius, f as XAUIShadow, g as XAUISourceColors, X as XAUITheme, h as XAUIThemeConfig, i as XAUIThemeSet } from './theme.type-C2gNHpEx.js';
|
|
20
|
+
export { b as InputContextValue, c as InputDescriptionProps, d as InputErrorProps, I as InputFieldProps, e as InputLabelPlacement, f as InputLabelProps, a as InputProps, g as InputSize, h as InputSlot, i as InputVariant } from './input.type-DjyZ6P2C.js';
|
|
18
21
|
export { A as AnimationConfig, a as AnimationProp, F as FeedbackContext, P as PressableFeedbackProps, R as RadiusStyle, b as ResolvedAnimation, c as RippleWave, S as SlotAnimation } from './pressable-feedback.type-Bs4dQlGj.js';
|
|
19
22
|
import 'react-native-reanimated';
|
|
20
23
|
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextSpan,
|
|
3
|
+
Typography,
|
|
4
|
+
typographyRecipe
|
|
5
|
+
} from "./chunk-G52TQJBI.js";
|
|
6
|
+
import {
|
|
7
|
+
Column,
|
|
8
|
+
Grid,
|
|
9
|
+
Row,
|
|
10
|
+
Stack,
|
|
11
|
+
useGrid
|
|
12
|
+
} from "./chunk-OYZYWWJ6.js";
|
|
1
13
|
import {
|
|
2
14
|
Portal,
|
|
3
15
|
PortalContext,
|
|
@@ -14,38 +26,38 @@ import {
|
|
|
14
26
|
primitives,
|
|
15
27
|
sourceKeys,
|
|
16
28
|
tokens
|
|
17
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TZG3DERP.js";
|
|
18
30
|
import {
|
|
19
31
|
Alert,
|
|
20
32
|
alertRecipe,
|
|
21
33
|
useAlert
|
|
22
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AXSJPWSJ.js";
|
|
23
35
|
import {
|
|
24
36
|
Button,
|
|
25
37
|
buttonRecipe,
|
|
26
38
|
useButton
|
|
27
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-MRYLLKML.js";
|
|
28
40
|
import {
|
|
29
41
|
CARD_BACKGROUND,
|
|
30
42
|
Card,
|
|
31
43
|
cardRecipe,
|
|
32
44
|
markBackground,
|
|
33
45
|
useCard
|
|
34
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-ZTA47PO5.js";
|
|
35
47
|
import {
|
|
36
48
|
Chip,
|
|
37
49
|
chipRecipe,
|
|
38
50
|
useChip
|
|
39
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-4J26FA6O.js";
|
|
40
52
|
import {
|
|
41
53
|
CloseButton,
|
|
42
54
|
closeButtonBase
|
|
43
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-A4RGJBP2.js";
|
|
44
56
|
import {
|
|
45
57
|
Icon,
|
|
46
58
|
IconContext,
|
|
47
59
|
useIconContext
|
|
48
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ICR42HHG.js";
|
|
49
61
|
import {
|
|
50
62
|
FEEDBACK_OVERLAY,
|
|
51
63
|
HIGHLIGHT_DURATION,
|
|
@@ -67,37 +79,39 @@ import {
|
|
|
67
79
|
resolveSlotAnimation,
|
|
68
80
|
rippleRadiusFor,
|
|
69
81
|
useFeedback,
|
|
70
|
-
usePressState
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
usePressState
|
|
83
|
+
} from "./chunk-4HELPMAK.js";
|
|
84
|
+
import {
|
|
85
|
+
InputOTP,
|
|
86
|
+
OTP_ALPHANUMERIC,
|
|
87
|
+
OTP_DIGITS,
|
|
88
|
+
OTP_LETTERS,
|
|
89
|
+
buildSlots,
|
|
90
|
+
extractPastedCode,
|
|
91
|
+
inputOTPRecipe,
|
|
92
|
+
useControllableState,
|
|
93
|
+
useInputOTP,
|
|
94
|
+
useInputOTPBox
|
|
95
|
+
} from "./chunk-I6UCYAO2.js";
|
|
96
|
+
import "./chunk-EGLLDKN6.js";
|
|
97
|
+
import {
|
|
98
|
+
TextArea,
|
|
99
|
+
useTextArea
|
|
100
|
+
} from "./chunk-ZDCGPK5Z.js";
|
|
73
101
|
import {
|
|
74
102
|
Input,
|
|
103
|
+
InputDescription,
|
|
104
|
+
InputError,
|
|
105
|
+
InputField,
|
|
106
|
+
InputLabel,
|
|
107
|
+
InputRoot,
|
|
75
108
|
inputRecipe,
|
|
76
109
|
useInput
|
|
77
|
-
} from "./chunk-
|
|
78
|
-
import {
|
|
79
|
-
TextSpan,
|
|
80
|
-
Typography,
|
|
81
|
-
typographyRecipe
|
|
82
|
-
} from "./chunk-2U6JR7BF.js";
|
|
110
|
+
} from "./chunk-2OY76YNB.js";
|
|
83
111
|
import {
|
|
84
112
|
createRecipe,
|
|
85
113
|
radiusAxis
|
|
86
114
|
} from "./chunk-3JATAB7S.js";
|
|
87
|
-
import {
|
|
88
|
-
ThemeContext,
|
|
89
|
-
deriveTint,
|
|
90
|
-
useColorMode,
|
|
91
|
-
useThemeColor,
|
|
92
|
-
useXAUITheme
|
|
93
|
-
} from "./chunk-A3EGFI6T.js";
|
|
94
|
-
import {
|
|
95
|
-
Column,
|
|
96
|
-
Grid,
|
|
97
|
-
Row,
|
|
98
|
-
Stack,
|
|
99
|
-
useGrid
|
|
100
|
-
} from "./chunk-OYZYWWJ6.js";
|
|
101
115
|
import {
|
|
102
116
|
Slot,
|
|
103
117
|
childrenToString,
|
|
@@ -106,43 +120,15 @@ import {
|
|
|
106
120
|
mergeRefs,
|
|
107
121
|
useStyleProps
|
|
108
122
|
} from "./chunk-PMO62QK4.js";
|
|
123
|
+
import {
|
|
124
|
+
ThemeContext,
|
|
125
|
+
deriveTint,
|
|
126
|
+
useColorMode,
|
|
127
|
+
useThemeColor,
|
|
128
|
+
useXAUITheme
|
|
129
|
+
} from "./chunk-A3EGFI6T.js";
|
|
109
130
|
import "./chunk-GGW42MY4.js";
|
|
110
131
|
|
|
111
|
-
// src/hooks/use-controllable-state.ts
|
|
112
|
-
import { useCallback, useRef, useState } from "react";
|
|
113
|
-
function useControllableState({
|
|
114
|
-
value,
|
|
115
|
-
defaultValue,
|
|
116
|
-
onChange
|
|
117
|
-
}) {
|
|
118
|
-
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
119
|
-
const isControlled = value !== void 0;
|
|
120
|
-
const current = isControlled ? value : uncontrolled;
|
|
121
|
-
useControlWarning(isControlled);
|
|
122
|
-
const latest = useRef(current);
|
|
123
|
-
latest.current = current;
|
|
124
|
-
const onChangeRef = useRef(onChange);
|
|
125
|
-
onChangeRef.current = onChange;
|
|
126
|
-
const controlled = useRef(isControlled);
|
|
127
|
-
controlled.current = isControlled;
|
|
128
|
-
const set = useCallback((next) => {
|
|
129
|
-
const resolved = typeof next === "function" ? next(latest.current) : next;
|
|
130
|
-
if (resolved === latest.current) return;
|
|
131
|
-
if (!controlled.current) setUncontrolled(resolved);
|
|
132
|
-
onChangeRef.current?.(resolved);
|
|
133
|
-
}, []);
|
|
134
|
-
return [current, set];
|
|
135
|
-
}
|
|
136
|
-
function useControlWarning(isControlled) {
|
|
137
|
-
const wasControlled = useRef(isControlled);
|
|
138
|
-
if (wasControlled.current !== isControlled) {
|
|
139
|
-
warnDev(
|
|
140
|
-
`a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
|
|
141
|
-
);
|
|
142
|
-
wasControlled.current = isControlled;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
132
|
// src/hooks/use-merged-ref.ts
|
|
147
133
|
import { useMemo } from "react";
|
|
148
134
|
function useMergedRef(...refs) {
|
|
@@ -150,9 +136,9 @@ function useMergedRef(...refs) {
|
|
|
150
136
|
}
|
|
151
137
|
|
|
152
138
|
// src/hooks/use-previous.ts
|
|
153
|
-
import { useEffect, useRef
|
|
139
|
+
import { useEffect, useRef } from "react";
|
|
154
140
|
function usePrevious(value) {
|
|
155
|
-
const previous =
|
|
141
|
+
const previous = useRef(void 0);
|
|
156
142
|
useEffect(() => {
|
|
157
143
|
previous.current = value;
|
|
158
144
|
}, [value]);
|
|
@@ -173,6 +159,15 @@ export {
|
|
|
173
159
|
Icon,
|
|
174
160
|
IconContext,
|
|
175
161
|
Input,
|
|
162
|
+
InputDescription,
|
|
163
|
+
InputError,
|
|
164
|
+
InputField,
|
|
165
|
+
InputLabel,
|
|
166
|
+
InputOTP,
|
|
167
|
+
InputRoot,
|
|
168
|
+
OTP_ALPHANUMERIC,
|
|
169
|
+
OTP_DIGITS,
|
|
170
|
+
OTP_LETTERS,
|
|
176
171
|
PRESS_DURATION,
|
|
177
172
|
PRESS_SCALE,
|
|
178
173
|
Portal,
|
|
@@ -190,6 +185,7 @@ export {
|
|
|
190
185
|
SCALE_REFERENCE_WIDTH,
|
|
191
186
|
Slot,
|
|
192
187
|
Stack,
|
|
188
|
+
TextArea,
|
|
193
189
|
TextSpan,
|
|
194
190
|
ThemeContext,
|
|
195
191
|
Typography,
|
|
@@ -197,6 +193,7 @@ export {
|
|
|
197
193
|
alertRecipe,
|
|
198
194
|
buildRadius,
|
|
199
195
|
buildShadows,
|
|
196
|
+
buildSlots,
|
|
200
197
|
buttonRecipe,
|
|
201
198
|
cardRecipe,
|
|
202
199
|
childrenToString,
|
|
@@ -208,6 +205,8 @@ export {
|
|
|
208
205
|
defaultTheme,
|
|
209
206
|
deriveColors,
|
|
210
207
|
deriveTint,
|
|
208
|
+
extractPastedCode,
|
|
209
|
+
inputOTPRecipe,
|
|
211
210
|
inputRecipe,
|
|
212
211
|
markBackground,
|
|
213
212
|
markOverlay,
|
|
@@ -233,10 +232,13 @@ export {
|
|
|
233
232
|
useGrid,
|
|
234
233
|
useIconContext,
|
|
235
234
|
useInput,
|
|
235
|
+
useInputOTP,
|
|
236
|
+
useInputOTPBox,
|
|
236
237
|
useMergedRef,
|
|
237
238
|
usePressState,
|
|
238
239
|
usePrevious,
|
|
239
240
|
useStyleProps,
|
|
241
|
+
useTextArea,
|
|
240
242
|
useThemeColor,
|
|
241
243
|
useXAUITheme
|
|
242
244
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, TextInputProps, TextProps, ViewStyle, ViewProps } from 'react-native';
|
|
3
|
+
import { T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.cjs';
|
|
4
|
+
import { S as Size, R as RadiusKey } from './theme.type-C2gNHpEx.cjs';
|
|
5
|
+
|
|
6
|
+
type InputSlot = 'root' | 'label' | 'field' | 'textArea' | 'placeholder' | 'description' | 'error';
|
|
7
|
+
/**
|
|
8
|
+
* The library's four emphasis levels, narrowed like the `Card`'s (§1 bis). A field
|
|
9
|
+
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
10
|
+
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
*
|
|
12
|
+
* This is where the theme's `field*` family is finally read, and the four names split
|
|
13
|
+
* HeroUI's two-name `primary | secondary` by saying what each of their ends already is:
|
|
14
|
+
*
|
|
15
|
+
* - **`primary`** — the `fieldBackground` fill plus the theme's `field` shadow. HeroUI's
|
|
16
|
+
* `primary`, with the elevation their flat token only implies.
|
|
17
|
+
* - **`secondary`** — the neutral `default` fill. HeroUI's `secondary`, and the default
|
|
18
|
+
* here: on a plain background a white field is its border and nothing else, while on a
|
|
19
|
+
* card the `fieldBackground` token *is* the card's own colour.
|
|
20
|
+
* - **`tertiary`** — the border alone, no fill. The same drop the `Button`'s `tertiary`
|
|
21
|
+
* makes.
|
|
22
|
+
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
23
|
+
* to move, so its focus shows in the caret alone.
|
|
24
|
+
*
|
|
25
|
+
* The first three name the `fieldBorder` edge and `ghost` gives it up. Its width is the
|
|
26
|
+
* theme's `borderWidth.field` — HeroUI's `--field-border-width`, which they ship at `0`
|
|
27
|
+
* and we ship at `1`. That is the one shipped default where the two differ;
|
|
28
|
+
* `createTheme({ borderWidth: { field: 0 } })` reproduces theirs.
|
|
29
|
+
*/
|
|
30
|
+
type InputVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
31
|
+
/**
|
|
32
|
+
* Where the label sits relative to the field's box.
|
|
33
|
+
*
|
|
34
|
+
* `outside` is the label above the box, in the column's flow. `inside` lifts it into the
|
|
35
|
+
* box, above the text — the label is taken **out of flow** and placed against the box's
|
|
36
|
+
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
37
|
+
*
|
|
38
|
+
* Because the inside label positions itself against the top of the root, it assumes the
|
|
39
|
+
* field is the first thing in the column's flow: write `Input.Description` and
|
|
40
|
+
* `Input.Error` after the field, which is where they belong anyway.
|
|
41
|
+
*/
|
|
42
|
+
type InputLabelPlacement = 'outside' | 'inside';
|
|
43
|
+
type InputSize = Size;
|
|
44
|
+
/**
|
|
45
|
+
* What the `Input` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type InputOwnProps = {
|
|
50
|
+
variant?: InputVariant;
|
|
51
|
+
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
52
|
+
size?: InputSize;
|
|
53
|
+
/** Overrides the `field` radius the theme chose for every size. */
|
|
54
|
+
radius?: RadiusKey;
|
|
55
|
+
/** Above the box, or lifted into it. @default 'outside' */
|
|
56
|
+
labelPlacement?: InputLabelPlacement;
|
|
57
|
+
/**
|
|
58
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
59
|
+
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
60
|
+
* colour is a role like any other, it is also what the field borders on focus.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
65
|
+
* treatment off: an error outranks focus, and a field that is both should read as
|
|
66
|
+
* wrong rather than as busy.
|
|
67
|
+
*
|
|
68
|
+
* It does **not** mount or unmount `Input.Error`. That stays the caller's — a slot that
|
|
69
|
+
* silently renders nothing is a slot you cannot debug.
|
|
70
|
+
*/
|
|
71
|
+
isInvalid?: boolean;
|
|
72
|
+
/** Dims the field and makes it uneditable. */
|
|
73
|
+
isDisabled?: boolean;
|
|
74
|
+
style?: StyleProp<ViewStyle>;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* R14 — the input's own props, the wrapper `View`'s, and every `ViewStyle` key neither
|
|
79
|
+
* already claims. **`TextInputProps` are not here**: they belong to `Input.Field`, which
|
|
80
|
+
* is the node that has them.
|
|
81
|
+
*/
|
|
82
|
+
type InputProps = InputOwnProps & Omit<ViewProps, keyof InputOwnProps> & Omit<ViewStyleProps, keyof InputOwnProps | keyof ViewProps> & {
|
|
83
|
+
/** R12 — merge into the single child instead of rendering a `View`. */
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Everything `TextInput` accepts, plus the `TextStyle` keys as props (R14).
|
|
88
|
+
*
|
|
89
|
+
* `editable` is absent: it is `disabled` under another name, and R8 keeps that off the
|
|
90
|
+
* public surface — `isDisabled` on the root is what stops the field.
|
|
91
|
+
*/
|
|
92
|
+
type InputFieldProps = Omit<TextInputProps, 'editable'> & Omit<TextStyleProps, keyof TextInputProps>;
|
|
93
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
94
|
+
type InputTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
};
|
|
97
|
+
type InputLabelProps = InputTextProps;
|
|
98
|
+
type InputDescriptionProps = InputTextProps;
|
|
99
|
+
type InputErrorProps = InputTextProps;
|
|
100
|
+
/**
|
|
101
|
+
* Read off `TextInput`'s own props rather than spelled out: React Native has renamed the
|
|
102
|
+
* payload of these two more than once, and a hand-written `NativeSyntheticEvent<…>` here
|
|
103
|
+
* would be a second declaration free to drift from the node that actually fires them.
|
|
104
|
+
*/
|
|
105
|
+
type FieldFocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];
|
|
106
|
+
type FieldBlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];
|
|
107
|
+
/**
|
|
108
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
109
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
110
|
+
* merges its own `style` on top and does no work of its own.
|
|
111
|
+
*/
|
|
112
|
+
type InputContextValue = {
|
|
113
|
+
labelStyle: StyleProp<TextStyle>;
|
|
114
|
+
fieldStyle: StyleProp<TextStyle>;
|
|
115
|
+
/** Layered *over* `fieldStyle` by `Input.TextArea`: only what a multiline field adds. */
|
|
116
|
+
textAreaStyle: StyleProp<TextStyle>;
|
|
117
|
+
/**
|
|
118
|
+
* Values, not a style: `rows` is a raw number, so the height it implies is arithmetic
|
|
119
|
+
* the slot does — and these are the two measurements it needs, flattened once here
|
|
120
|
+
* rather than in every text area on the screen.
|
|
121
|
+
*/
|
|
122
|
+
textArea: {
|
|
123
|
+
lineHeight: number;
|
|
124
|
+
paddingVertical: number;
|
|
125
|
+
};
|
|
126
|
+
descriptionStyle: StyleProp<TextStyle>;
|
|
127
|
+
errorStyle: StyleProp<TextStyle>;
|
|
128
|
+
/**
|
|
129
|
+
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
130
|
+
* flattens its placeholder slot once here rather than in the field.
|
|
131
|
+
*/
|
|
132
|
+
placeholderTextColor?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
135
|
+
* and it needs the value before it renders — but the node that hears the event is
|
|
136
|
+
* `Input.Field`, three levels down. These are how it reports back. Their identity is
|
|
137
|
+
* stable, so publishing them costs no re-render of a memoized slot.
|
|
138
|
+
*/
|
|
139
|
+
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
140
|
+
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
141
|
+
/**
|
|
142
|
+
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
143
|
+
* champ de saisie" rather than just the placeholder.
|
|
144
|
+
*/
|
|
145
|
+
labelId: string;
|
|
146
|
+
descriptionId: string;
|
|
147
|
+
isDisabled: boolean;
|
|
148
|
+
isInvalid: boolean;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type { InputFieldProps as I, InputProps as a, InputContextValue as b, InputDescriptionProps as c, InputErrorProps as d, InputLabelPlacement as e, InputLabelProps as f, InputSize as g, InputSlot as h, InputVariant as i };
|