@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-27ZRTZEE.js +293 -0
- package/dist/chunk-3FV4COTM.js +68 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4XPLPQLM.cjs +147 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5GO7MAVY.cjs +74 -0
- package/dist/chunk-5RQ7AZPN.cjs +455 -0
- package/dist/chunk-5Z4P6WHR.cjs +525 -0
- package/dist/chunk-6RVCGLKZ.js +661 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7SEZGVTY.js +62 -0
- package/dist/chunk-7XKQJQF2.cjs +70 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-A5OCK3C2.js +525 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BFMTUMTU.js +669 -0
- package/dist/chunk-BVJQ3UPZ.js +62 -0
- package/dist/chunk-DFME724B.js +147 -0
- package/dist/chunk-E2CWBQTV.js +119 -0
- package/dist/chunk-E4TS6632.cjs +314 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FMZQW35T.js +431 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7K652GC.js +145 -0
- package/dist/chunk-GGW42MY4.js +20 -0
- package/dist/chunk-GI24YJPE.js +314 -0
- package/dist/chunk-GLGU2WFL.cjs +190 -0
- package/dist/chunk-GPVNCJ3Z.cjs +696 -0
- package/dist/chunk-GVQOD3VW.js +74 -0
- package/dist/chunk-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/chunk-KWCHSIMI.cjs +293 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/chunk-N527BTY4.cjs +366 -0
- package/dist/chunk-NBFWWQFW.cjs +346 -0
- package/dist/chunk-NYRXUGVL.js +104 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
- package/dist/chunk-Q3WFY5N3.js +366 -0
- package/dist/chunk-QGN2BBJO.cjs +104 -0
- package/dist/chunk-TGZZ3RZU.cjs +86 -0
- package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
- package/dist/chunk-UBQLKIZC.cjs +431 -0
- package/dist/chunk-URSKA2VR.js +190 -0
- package/dist/chunk-V4WDMM6Z.js +86 -0
- package/dist/chunk-VJEER76X.js +455 -0
- package/dist/chunk-VZBWYWEI.cjs +736 -0
- package/dist/chunk-WR7YLDVV.cjs +68 -0
- package/dist/chunk-X4HQ4H2V.js +701 -0
- package/dist/chunk-XFSW3ZNI.cjs +145 -0
- package/dist/chunk-XQFAUDR2.cjs +62 -0
- package/dist/chunk-YKL6XHM6.js +346 -0
- package/dist/chunk-ZP2E2H2G.cjs +119 -0
- package/dist/chunk-ZSLNGBDS.cjs +700 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -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/button/index.cjs +21 -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 +21 -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/input/index.cjs +25 -0
- package/dist/components/input/index.d.cts +205 -0
- package/dist/components/input/index.d.ts +205 -0
- package/dist/components/input/index.js +25 -0
- package/dist/components/input-group/index.cjs +27 -0
- package/dist/components/input-group/index.d.cts +270 -0
- package/dist/components/input-group/index.d.ts +270 -0
- package/dist/components/input-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/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/spinner/index.cjs +16 -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 +16 -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/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 +246 -4
- package/dist/index.d.cts +109 -4
- package/dist/index.d.ts +109 -4
- package/dist/index.js +266 -24
- package/dist/input.type-BUMDlzL9.d.cts +167 -0
- package/dist/input.type-D2qgi03E.d.ts +167 -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 +60 -3
- package/dist/system/index.d.cts +347 -181
- package/dist/system/index.d.ts +347 -181
- package/dist/system/index.js +71 -14
- package/dist/theme/index.cjs +4 -3
- package/dist/theme/index.d.cts +34 -23
- package/dist/theme/index.d.ts +34 -23
- package/dist/theme/index.js +3 -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 +174 -18
- package/dist/chunk-QAMNNTGM.js +0 -637
- package/dist/chunk-V63JO65F.cjs +0 -637
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,111 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Alert, AlertCloseProps, AlertContentProps, AlertContextValue, AlertDescriptionProps, AlertIconProps, AlertProps, AlertSize, AlertSlot, AlertTitleProps, AlertVariant, alertRecipe, useAlert } from './components/alert/index.js';
|
|
2
|
+
export { Button, ButtonContextValue, ButtonIconProps, ButtonLabelProps, ButtonProps, ButtonSize, ButtonSlot, ButtonSpinnerProps, ButtonVariant, buttonRecipe, useButton } from './components/button/index.js';
|
|
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
|
+
export { Checkbox, CheckboxContextValue, CheckboxIndicator, CheckboxIndicatorProps, CheckboxLabel, CheckboxLabelProps, CheckboxProps, CheckboxRoot, CheckboxSize, CheckboxSlot, CheckboxVariant, checkboxRecipe, useCheckbox } from './components/checkbox/index.js';
|
|
5
|
+
export { Chip, ChipAvatarProps, ChipCloseProps, ChipContextValue, ChipDotProps, ChipIconProps, ChipLabelProps, ChipProps, ChipSize, ChipSlot, ChipVariant, chipRecipe, useChip } from './components/chip/index.js';
|
|
6
|
+
export { Input, InputDescription, InputError, InputField, InputLabel, InputRoot, inputRecipe, useInput } from './components/input/index.js';
|
|
7
|
+
export { InputGroup, InputGroupContextValue, InputGroupField, InputGroupFieldProps, InputGroupIcon, InputGroupIconProps, InputGroupPrefix, InputGroupPrefixProps, InputGroupProps, InputGroupRoot, InputGroupSide, InputGroupSuffix, InputGroupSuffixProps, decoratorPadding, useInputGroup } from './components/input-group/index.js';
|
|
8
|
+
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';
|
|
9
|
+
export { Radio, RadioContextValue, RadioIndicator, RadioIndicatorProps, RadioLabel, RadioLabelProps, RadioProps, RadioRoot, RadioSize, RadioSlot, RadioVariant, radioRecipe, useRadio } from './components/radio/index.js';
|
|
10
|
+
export { Spinner, SpinnerProps, SpinnerSize, SpinnerSlot, SpinnerVariant, spinnerRecipe } from './components/spinner/index.js';
|
|
11
|
+
export { Switch, SwitchContextValue, SwitchLabel, SwitchLabelProps, SwitchProps, SwitchRoot, SwitchSize, SwitchSlot, SwitchThumb, SwitchThumbProps, SwitchTrack, SwitchTrackProps, SwitchVariant, switchRecipe, useSwitch } from './components/switch/index.js';
|
|
12
|
+
export { TextArea, TextAreaContextValue, TextAreaFieldProps, TextAreaProps, useTextArea } from './components/text-area/index.js';
|
|
13
|
+
export { TextSpan, TextSpanProps, Typography, TypographyProps, TypographySlot, TypographyVariant, typographyRecipe } from './components/typography/index.js';
|
|
14
|
+
export { AxisProps, Column, ColumnProps, Grid, GridContextValue, GridItemProps, GridProps, Row, RowProps, Stack, StackItemProps, StackProps, useGrid } from './components/view/index.js';
|
|
15
|
+
import { RefCallback } from 'react';
|
|
16
|
+
import { PossibleRef } from './system/index.js';
|
|
17
|
+
export { AsChildProps, CloseButton, CloseButtonSlots, FEEDBACK_OVERLAY, HIGHLIGHT_DURATION, HIGHLIGHT_OPACITY, Icon, IconContext, MergeableProps, PRESS_DURATION, PRESS_SCALE, Portal, PortalContext, PortalHost, PortalHostProps, PortalMethods, PortalProps, PressableFeedback, PressableFeedbackHighlightProps, PressableFeedbackRippleProps, RIPPLE_CONFIRM_DURATION, RIPPLE_EXPAND_DURATION, RIPPLE_FADE_IN, RIPPLE_FADE_OUT, RIPPLE_FADE_OUT_DELAY, RIPPLE_OPACITY, RIPPLE_START_SCALE, SCALE_REFERENCE_WIDTH, SelectionFill, SelectionFillProps, Slot, SlotProps, childrenToString, closeButtonBase, createSlotContext, markOverlay, mergeProps, mergeRefs, pressScaleFor, radiusAxis, resolveAnimation, resolveSlotAnimation, rippleRadiusFor, useFeedback, useIconContext, useStyleProps } from './system/index.js';
|
|
18
|
+
import { GestureResponderEvent, ViewStyle } from 'react-native';
|
|
19
|
+
export { C as CloseButtonProps } from './close-button.type-BUYuoSt2.js';
|
|
20
|
+
export { b as IconComponentProps, I as IconContextValue, a as IconProps } from './icon.type-Kml72iSz.js';
|
|
21
|
+
export { A as Axes, C as CompoundVariant, R as Recipe, d as RecipeConfig, b as ResolveArgs, e as ResolvedSelection, f as ResolvedStyles, g as Selection, h as SlotStyle, S as SlotStyles, i as StateName, j as States, a as StyleFn, T as TintArgs, V as VariantColors, k as VariantRole, l as VariantTokens, c as createRecipe } from './create-recipe-BdVd2ffi.js';
|
|
22
|
+
export { D as DirectionalStyleKey, I as ImageStyleProps, S as StyleProps, T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.js';
|
|
2
23
|
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';
|
|
3
|
-
export { C as ColorMode, F as FontSizeKey,
|
|
4
|
-
|
|
5
|
-
|
|
24
|
+
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';
|
|
25
|
+
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-D2qgi03E.js';
|
|
26
|
+
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';
|
|
6
27
|
import 'react-native-reanimated';
|
|
28
|
+
|
|
29
|
+
type ControllableStateOptions<T> = {
|
|
30
|
+
/** Present means controlled: the caller owns the value and this never stores one. */
|
|
31
|
+
value?: T;
|
|
32
|
+
/** The starting value when uncontrolled. */
|
|
33
|
+
defaultValue: T;
|
|
34
|
+
/** Called with every new value, controlled or not. */
|
|
35
|
+
onChange?: (value: T) => void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* One state that works both ways, so a component never has two code paths for "the
|
|
39
|
+
* caller drives this" and "we do".
|
|
40
|
+
*
|
|
41
|
+
* The setter is stable across renders and reads the current value from a ref, so a
|
|
42
|
+
* handler built on it can be passed to a memoized child without rebuilding it on every
|
|
43
|
+
* render — which is the whole reason components reach for this rather than a local
|
|
44
|
+
* `useState` plus an `if`.
|
|
45
|
+
*/
|
|
46
|
+
declare function useControllableState<T>({ value, defaultValue, onChange, }: ControllableStateOptions<T>): [T, (next: T | ((current: T) => T)) => void];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* `mergeRefs` for a component that renders: memoized on the refs it was given, so React
|
|
50
|
+
* does not detach and reattach every one of them on each render — which it does whenever
|
|
51
|
+
* a ref callback changes identity, and which costs a node measurement every time.
|
|
52
|
+
*/
|
|
53
|
+
declare function useMergedRef<T>(...refs: Array<PossibleRef<T>>): RefCallback<T>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* `null` as much as `undefined`: that is how `PressableProps` types its handlers, and a
|
|
57
|
+
* root forwarding what it was given should not have to launder them first.
|
|
58
|
+
*/
|
|
59
|
+
type PressHandlers = {
|
|
60
|
+
onPressIn?: PressHandler | null;
|
|
61
|
+
onPressOut?: PressHandler | null;
|
|
62
|
+
};
|
|
63
|
+
type PressHandler = (event: GestureResponderEvent) => void;
|
|
64
|
+
/**
|
|
65
|
+
* The press state a root owns, with the handlers that maintain it.
|
|
66
|
+
*
|
|
67
|
+
* It exists because every pressable component needs the same three things and gets one
|
|
68
|
+
* of them wrong on its own: the state has to be *up here* — the recipe resolves on it
|
|
69
|
+
* (R5) — the caller's handlers must be **composed, never replaced**, and the returned
|
|
70
|
+
* handlers must keep their identity so passing them down does not defeat a memo.
|
|
71
|
+
*
|
|
72
|
+
* ```tsx
|
|
73
|
+
* const [isPressed, pressHandlers] = usePressState(props)
|
|
74
|
+
* const styles = recipe.resolve({ theme, selection, states: { pressed: isPressed } })
|
|
75
|
+
* <PressableFeedback isPressed={isPressed} {...pressHandlers} />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare function usePressState(handlers?: PressHandlers): [boolean, {
|
|
79
|
+
onPressIn: PressHandler;
|
|
80
|
+
onPressOut: PressHandler;
|
|
81
|
+
}];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The value from the render before this one, `undefined` on the first.
|
|
85
|
+
*
|
|
86
|
+
* Written in an effect rather than during render on purpose: reading it mid-render would
|
|
87
|
+
* make "previous" mean something different depending on whether React re-ran the render,
|
|
88
|
+
* which under StrictMode it does.
|
|
89
|
+
*/
|
|
90
|
+
declare function usePrevious<T>(value: T): T | undefined;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* One turn. Slow enough to read as waiting, fast enough not to read as stuck — HeroUI
|
|
94
|
+
* arrives at the same figure from the other side, a 1000ms turn played at 1.1×.
|
|
95
|
+
*
|
|
96
|
+
* It is a constant rather than a parameter because the library turns at one speed: two
|
|
97
|
+
* spinners on one screen at two rates is a bug, and the only way to be sure of that is
|
|
98
|
+
* for there to be one number.
|
|
99
|
+
*/
|
|
100
|
+
declare const ROTATION_DURATION = 900;
|
|
101
|
+
/**
|
|
102
|
+
* A full turn, repeating, on the UI thread. Returns the animated style to merge onto the
|
|
103
|
+
* node that spins.
|
|
104
|
+
*
|
|
105
|
+
* **A caller that must animate nothing does not call it.** Hooks cannot be conditional,
|
|
106
|
+
* so "no animation" is only true if this one is never reached — which is why both call
|
|
107
|
+
* sites render two components rather than branch inside one.
|
|
108
|
+
*/
|
|
109
|
+
declare function useRotation(): ViewStyle;
|
|
110
|
+
|
|
111
|
+
export { type ControllableStateOptions, PossibleRef, type PressHandlers, ROTATION_DURATION, useControllableState, useMergedRef, usePressState, usePrevious, useRotation };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HIGHLIGHT_OPACITY,
|
|
3
|
-
PRESS_DURATION,
|
|
4
|
-
PRESS_SCALE,
|
|
5
|
-
PressableFeedback,
|
|
6
|
-
RELEASE_DURATION,
|
|
7
|
-
RIPPLE_COVERAGE,
|
|
8
|
-
RIPPLE_DURATION,
|
|
9
|
-
RIPPLE_OPACITY,
|
|
10
|
-
Slot,
|
|
11
|
-
childrenToString,
|
|
12
|
-
createRecipe,
|
|
13
|
-
createSlotContext,
|
|
14
|
-
mergeProps,
|
|
15
|
-
mergeRefs,
|
|
16
|
-
resolveAnimation,
|
|
17
|
-
resolveSlotAnimation,
|
|
18
|
-
useFeedback
|
|
19
|
-
} from "./chunk-QAMNNTGM.js";
|
|
20
1
|
import {
|
|
21
2
|
XAUIProvider,
|
|
22
3
|
buildRadius,
|
|
@@ -28,45 +9,306 @@ import {
|
|
|
28
9
|
primitives,
|
|
29
10
|
sourceKeys,
|
|
30
11
|
tokens
|
|
31
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TZG3DERP.js";
|
|
13
|
+
import {
|
|
14
|
+
Radio,
|
|
15
|
+
RadioIndicator,
|
|
16
|
+
RadioLabel,
|
|
17
|
+
RadioRoot,
|
|
18
|
+
radioRecipe,
|
|
19
|
+
useRadio
|
|
20
|
+
} from "./chunk-27ZRTZEE.js";
|
|
21
|
+
import {
|
|
22
|
+
Spinner,
|
|
23
|
+
spinnerRecipe
|
|
24
|
+
} from "./chunk-KOC3KQIT.js";
|
|
25
|
+
import {
|
|
26
|
+
Switch,
|
|
27
|
+
SwitchLabel,
|
|
28
|
+
SwitchRoot,
|
|
29
|
+
SwitchThumb,
|
|
30
|
+
SwitchTrack,
|
|
31
|
+
switchRecipe,
|
|
32
|
+
useSwitch
|
|
33
|
+
} from "./chunk-6RVCGLKZ.js";
|
|
34
|
+
import {
|
|
35
|
+
TextArea,
|
|
36
|
+
useTextArea
|
|
37
|
+
} from "./chunk-GVQOD3VW.js";
|
|
38
|
+
import {
|
|
39
|
+
TextSpan,
|
|
40
|
+
Typography,
|
|
41
|
+
typographyRecipe
|
|
42
|
+
} from "./chunk-NYRXUGVL.js";
|
|
43
|
+
import {
|
|
44
|
+
Column,
|
|
45
|
+
Grid,
|
|
46
|
+
Row,
|
|
47
|
+
Stack,
|
|
48
|
+
useGrid
|
|
49
|
+
} from "./chunk-G7K652GC.js";
|
|
50
|
+
import {
|
|
51
|
+
Portal,
|
|
52
|
+
PortalContext,
|
|
53
|
+
PortalHost
|
|
54
|
+
} from "./chunk-7SEZGVTY.js";
|
|
55
|
+
import {
|
|
56
|
+
Alert,
|
|
57
|
+
alertRecipe,
|
|
58
|
+
useAlert
|
|
59
|
+
} from "./chunk-Q3WFY5N3.js";
|
|
60
|
+
import {
|
|
61
|
+
Button,
|
|
62
|
+
buttonRecipe,
|
|
63
|
+
useButton
|
|
64
|
+
} from "./chunk-GI24YJPE.js";
|
|
65
|
+
import {
|
|
66
|
+
ROTATION_DURATION,
|
|
67
|
+
useMergedRef,
|
|
68
|
+
usePrevious,
|
|
69
|
+
useRotation
|
|
70
|
+
} from "./chunk-BVJQ3UPZ.js";
|
|
71
|
+
import {
|
|
72
|
+
CARD_BACKGROUND,
|
|
73
|
+
Card,
|
|
74
|
+
cardRecipe,
|
|
75
|
+
markBackground,
|
|
76
|
+
useCard
|
|
77
|
+
} from "./chunk-VJEER76X.js";
|
|
78
|
+
import {
|
|
79
|
+
Checkbox,
|
|
80
|
+
CheckboxIndicator,
|
|
81
|
+
CheckboxLabel,
|
|
82
|
+
CheckboxRoot,
|
|
83
|
+
checkboxRecipe,
|
|
84
|
+
useCheckbox
|
|
85
|
+
} from "./chunk-YKL6XHM6.js";
|
|
86
|
+
import {
|
|
87
|
+
SelectionFill
|
|
88
|
+
} from "./chunk-BA2DBSAN.js";
|
|
89
|
+
import {
|
|
90
|
+
Chip,
|
|
91
|
+
chipRecipe,
|
|
92
|
+
useChip
|
|
93
|
+
} from "./chunk-FMZQW35T.js";
|
|
94
|
+
import {
|
|
95
|
+
CloseButton,
|
|
96
|
+
closeButtonBase
|
|
97
|
+
} from "./chunk-V4WDMM6Z.js";
|
|
98
|
+
import {
|
|
99
|
+
FEEDBACK_OVERLAY,
|
|
100
|
+
HIGHLIGHT_DURATION,
|
|
101
|
+
HIGHLIGHT_OPACITY,
|
|
102
|
+
PRESS_DURATION,
|
|
103
|
+
PRESS_SCALE,
|
|
104
|
+
PressableFeedback,
|
|
105
|
+
RIPPLE_CONFIRM_DURATION,
|
|
106
|
+
RIPPLE_EXPAND_DURATION,
|
|
107
|
+
RIPPLE_FADE_IN,
|
|
108
|
+
RIPPLE_FADE_OUT,
|
|
109
|
+
RIPPLE_FADE_OUT_DELAY,
|
|
110
|
+
RIPPLE_OPACITY,
|
|
111
|
+
RIPPLE_START_SCALE,
|
|
112
|
+
SCALE_REFERENCE_WIDTH,
|
|
113
|
+
markOverlay,
|
|
114
|
+
pressScaleFor,
|
|
115
|
+
resolveAnimation,
|
|
116
|
+
resolveSlotAnimation,
|
|
117
|
+
rippleRadiusFor,
|
|
118
|
+
useFeedback
|
|
119
|
+
} from "./chunk-BFMTUMTU.js";
|
|
120
|
+
import {
|
|
121
|
+
usePressState
|
|
122
|
+
} from "./chunk-423RQBOX.js";
|
|
123
|
+
import {
|
|
124
|
+
InputGroup,
|
|
125
|
+
InputGroupField,
|
|
126
|
+
InputGroupIcon,
|
|
127
|
+
InputGroupPrefix,
|
|
128
|
+
InputGroupRoot,
|
|
129
|
+
InputGroupSuffix,
|
|
130
|
+
decoratorPadding,
|
|
131
|
+
useInputGroup
|
|
132
|
+
} from "./chunk-DFME724B.js";
|
|
133
|
+
import {
|
|
134
|
+
Input,
|
|
135
|
+
InputDescription,
|
|
136
|
+
InputError,
|
|
137
|
+
InputField,
|
|
138
|
+
InputLabel,
|
|
139
|
+
InputRoot,
|
|
140
|
+
inputRecipe,
|
|
141
|
+
useInput
|
|
142
|
+
} from "./chunk-A5OCK3C2.js";
|
|
143
|
+
import {
|
|
144
|
+
Icon,
|
|
145
|
+
IconContext,
|
|
146
|
+
useIconContext
|
|
147
|
+
} from "./chunk-3FV4COTM.js";
|
|
148
|
+
import {
|
|
149
|
+
InputOTP,
|
|
150
|
+
OTP_ALPHANUMERIC,
|
|
151
|
+
OTP_DIGITS,
|
|
152
|
+
OTP_LETTERS,
|
|
153
|
+
buildSlots,
|
|
154
|
+
extractPastedCode,
|
|
155
|
+
inputOTPRecipe,
|
|
156
|
+
useInputOTP,
|
|
157
|
+
useInputOTPBox
|
|
158
|
+
} from "./chunk-X4HQ4H2V.js";
|
|
159
|
+
import {
|
|
160
|
+
useControllableState
|
|
161
|
+
} from "./chunk-F6W3JQ7K.js";
|
|
162
|
+
import "./chunk-EGLLDKN6.js";
|
|
163
|
+
import {
|
|
164
|
+
createRecipe,
|
|
165
|
+
radiusAxis
|
|
166
|
+
} from "./chunk-4GTAZM2C.js";
|
|
32
167
|
import {
|
|
33
168
|
ThemeContext,
|
|
34
169
|
deriveTint,
|
|
35
170
|
useColorMode,
|
|
36
171
|
useThemeColor,
|
|
37
172
|
useXAUITheme
|
|
38
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-A3EGFI6T.js";
|
|
174
|
+
import {
|
|
175
|
+
Slot,
|
|
176
|
+
childrenToString,
|
|
177
|
+
createSlotContext,
|
|
178
|
+
mergeProps
|
|
179
|
+
} from "./chunk-E2CWBQTV.js";
|
|
180
|
+
import {
|
|
181
|
+
mergeRefs,
|
|
182
|
+
useStyleProps
|
|
183
|
+
} from "./chunk-URSKA2VR.js";
|
|
184
|
+
import "./chunk-GGW42MY4.js";
|
|
39
185
|
export {
|
|
186
|
+
Alert,
|
|
187
|
+
Button,
|
|
188
|
+
CARD_BACKGROUND,
|
|
189
|
+
Card,
|
|
190
|
+
Checkbox,
|
|
191
|
+
CheckboxIndicator,
|
|
192
|
+
CheckboxLabel,
|
|
193
|
+
CheckboxRoot,
|
|
194
|
+
Chip,
|
|
195
|
+
CloseButton,
|
|
196
|
+
Column,
|
|
197
|
+
FEEDBACK_OVERLAY,
|
|
198
|
+
Grid,
|
|
199
|
+
HIGHLIGHT_DURATION,
|
|
40
200
|
HIGHLIGHT_OPACITY,
|
|
201
|
+
Icon,
|
|
202
|
+
IconContext,
|
|
203
|
+
Input,
|
|
204
|
+
InputDescription,
|
|
205
|
+
InputError,
|
|
206
|
+
InputField,
|
|
207
|
+
InputGroup,
|
|
208
|
+
InputGroupField,
|
|
209
|
+
InputGroupIcon,
|
|
210
|
+
InputGroupPrefix,
|
|
211
|
+
InputGroupRoot,
|
|
212
|
+
InputGroupSuffix,
|
|
213
|
+
InputLabel,
|
|
214
|
+
InputOTP,
|
|
215
|
+
InputRoot,
|
|
216
|
+
OTP_ALPHANUMERIC,
|
|
217
|
+
OTP_DIGITS,
|
|
218
|
+
OTP_LETTERS,
|
|
41
219
|
PRESS_DURATION,
|
|
42
220
|
PRESS_SCALE,
|
|
221
|
+
Portal,
|
|
222
|
+
PortalContext,
|
|
223
|
+
PortalHost,
|
|
43
224
|
PressableFeedback,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
225
|
+
RIPPLE_CONFIRM_DURATION,
|
|
226
|
+
RIPPLE_EXPAND_DURATION,
|
|
227
|
+
RIPPLE_FADE_IN,
|
|
228
|
+
RIPPLE_FADE_OUT,
|
|
229
|
+
RIPPLE_FADE_OUT_DELAY,
|
|
47
230
|
RIPPLE_OPACITY,
|
|
231
|
+
RIPPLE_START_SCALE,
|
|
232
|
+
ROTATION_DURATION,
|
|
233
|
+
Radio,
|
|
234
|
+
RadioIndicator,
|
|
235
|
+
RadioLabel,
|
|
236
|
+
RadioRoot,
|
|
237
|
+
Row,
|
|
238
|
+
SCALE_REFERENCE_WIDTH,
|
|
239
|
+
SelectionFill,
|
|
48
240
|
Slot,
|
|
241
|
+
Spinner,
|
|
242
|
+
Stack,
|
|
243
|
+
Switch,
|
|
244
|
+
SwitchLabel,
|
|
245
|
+
SwitchRoot,
|
|
246
|
+
SwitchThumb,
|
|
247
|
+
SwitchTrack,
|
|
248
|
+
TextArea,
|
|
249
|
+
TextSpan,
|
|
49
250
|
ThemeContext,
|
|
251
|
+
Typography,
|
|
50
252
|
XAUIProvider,
|
|
253
|
+
alertRecipe,
|
|
51
254
|
buildRadius,
|
|
52
255
|
buildShadows,
|
|
256
|
+
buildSlots,
|
|
257
|
+
buttonRecipe,
|
|
258
|
+
cardRecipe,
|
|
259
|
+
checkboxRecipe,
|
|
53
260
|
childrenToString,
|
|
261
|
+
chipRecipe,
|
|
262
|
+
closeButtonBase,
|
|
54
263
|
createRecipe,
|
|
55
264
|
createSlotContext,
|
|
56
265
|
createTheme,
|
|
266
|
+
decoratorPadding,
|
|
57
267
|
defaultTheme,
|
|
58
268
|
deriveColors,
|
|
59
269
|
deriveTint,
|
|
270
|
+
extractPastedCode,
|
|
271
|
+
inputOTPRecipe,
|
|
272
|
+
inputRecipe,
|
|
273
|
+
markBackground,
|
|
274
|
+
markOverlay,
|
|
60
275
|
mergeProps,
|
|
61
276
|
mergeRefs,
|
|
62
277
|
palette,
|
|
278
|
+
pressScaleFor,
|
|
63
279
|
primitives,
|
|
280
|
+
radioRecipe,
|
|
281
|
+
radiusAxis,
|
|
64
282
|
resolveAnimation,
|
|
65
283
|
resolveSlotAnimation,
|
|
284
|
+
rippleRadiusFor,
|
|
66
285
|
sourceKeys,
|
|
286
|
+
spinnerRecipe,
|
|
287
|
+
switchRecipe,
|
|
67
288
|
tokens,
|
|
289
|
+
typographyRecipe,
|
|
290
|
+
useAlert,
|
|
291
|
+
useButton,
|
|
292
|
+
useCard,
|
|
293
|
+
useCheckbox,
|
|
294
|
+
useChip,
|
|
68
295
|
useColorMode,
|
|
296
|
+
useControllableState,
|
|
69
297
|
useFeedback,
|
|
298
|
+
useGrid,
|
|
299
|
+
useIconContext,
|
|
300
|
+
useInput,
|
|
301
|
+
useInputGroup,
|
|
302
|
+
useInputOTP,
|
|
303
|
+
useInputOTPBox,
|
|
304
|
+
useMergedRef,
|
|
305
|
+
usePressState,
|
|
306
|
+
usePrevious,
|
|
307
|
+
useRadio,
|
|
308
|
+
useRotation,
|
|
309
|
+
useStyleProps,
|
|
310
|
+
useSwitch,
|
|
311
|
+
useTextArea,
|
|
70
312
|
useThemeColor,
|
|
71
313
|
useXAUITheme
|
|
72
314
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle, TextInputProps, TextProps, ViewProps } from 'react-native';
|
|
3
|
+
import { T as TextStyleProps, V as ViewStyleProps } from './style-props.type-CfnoGEP7.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' | 'prefix' | 'suffix' | 'icon';
|
|
7
|
+
/**
|
|
8
|
+
* The library's four emphasis levels, narrowed like the `Card`'s (§1 bis). A field
|
|
9
|
+
* **reports nothing** — an error is `isInvalid`, which is a state and not a variant — so
|
|
10
|
+
* `success`, `warning` and `danger` are absent here for the same reason they are there.
|
|
11
|
+
*
|
|
12
|
+
* This is where the theme's `field*` family is finally read, and the four names split
|
|
13
|
+
* HeroUI's two-name `primary | secondary` by saying what each of their ends already is:
|
|
14
|
+
*
|
|
15
|
+
* - **`primary`** — the `fieldBackground` fill plus the theme's `field` shadow. HeroUI's
|
|
16
|
+
* `primary`, with the elevation their flat token only implies.
|
|
17
|
+
* - **`secondary`** — the neutral `default` fill. HeroUI's `secondary`, and the default
|
|
18
|
+
* here: on a plain background a white field is its border and nothing else, while on a
|
|
19
|
+
* card the `fieldBackground` token *is* the card's own colour.
|
|
20
|
+
* - **`tertiary`** — the border alone, no fill. The same drop the `Button`'s `tertiary`
|
|
21
|
+
* makes.
|
|
22
|
+
* - **`ghost`** — neither. A bare field for a toolbar or an inline edit; it has no border
|
|
23
|
+
* to move, so its focus shows in the caret alone.
|
|
24
|
+
*
|
|
25
|
+
* The first three name the `fieldBorder` edge and `ghost` gives it up. Its width is the
|
|
26
|
+
* theme's `borderWidth.field` — HeroUI's `--field-border-width`, which they ship at `0`
|
|
27
|
+
* and we ship at `1`. That is the one shipped default where the two differ;
|
|
28
|
+
* `createTheme({ borderWidth: { field: 0 } })` reproduces theirs.
|
|
29
|
+
*/
|
|
30
|
+
type InputVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
31
|
+
/**
|
|
32
|
+
* Where the label sits relative to the field's box.
|
|
33
|
+
*
|
|
34
|
+
* `outside` is the label above the box, in the column's flow. `inside` lifts it into the
|
|
35
|
+
* box, above the text — the label is taken **out of flow** and placed against the box's
|
|
36
|
+
* own padding, so the JSX is identical either way and nothing is reparented (R4).
|
|
37
|
+
*
|
|
38
|
+
* Because the inside label positions itself against the top of the root, it assumes the
|
|
39
|
+
* field is the first thing in the column's flow: write `Input.Description` and
|
|
40
|
+
* `Input.Error` after the field, which is where they belong anyway.
|
|
41
|
+
*/
|
|
42
|
+
type InputLabelPlacement = 'outside' | 'inside';
|
|
43
|
+
type InputSize = Size;
|
|
44
|
+
/**
|
|
45
|
+
* What the `Input` itself understands. R14 — a name in here is the component's, so the
|
|
46
|
+
* style prop that shares it is not exposed: `size` is the field's scale and never
|
|
47
|
+
* `ViewStyle`'s, and `color` is R7's tint.
|
|
48
|
+
*/
|
|
49
|
+
type InputOwnProps = {
|
|
50
|
+
variant?: InputVariant;
|
|
51
|
+
/** The field's height, its padding, the gaps and the type. Never width. */
|
|
52
|
+
size?: InputSize;
|
|
53
|
+
/** Overrides the `field` radius the theme chose for every size. */
|
|
54
|
+
radius?: RadiusKey;
|
|
55
|
+
/** Above the box, or lifted into it. @default 'outside' */
|
|
56
|
+
labelPlacement?: InputLabelPlacement;
|
|
57
|
+
/**
|
|
58
|
+
* A raw tint (`'#7c3aed'`), never a token (R7). It lands where the variant put its
|
|
59
|
+
* tokens — the fill of a `default`, the border of a `tertiary` — and, because the focus
|
|
60
|
+
* colour is a role like any other, it is also what the field borders on focus.
|
|
61
|
+
*/
|
|
62
|
+
color?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Paints the border, the label and the description in `danger`, and takes the focus
|
|
65
|
+
* treatment off: an error outranks focus, and a field that is both should read as
|
|
66
|
+
* wrong rather than as busy.
|
|
67
|
+
*
|
|
68
|
+
* It does **not** mount or unmount `Input.Error`. That stays the caller's — a slot that
|
|
69
|
+
* silently renders nothing is a slot you cannot debug.
|
|
70
|
+
*/
|
|
71
|
+
isInvalid?: boolean;
|
|
72
|
+
/** Dims the field and makes it uneditable. */
|
|
73
|
+
isDisabled?: boolean;
|
|
74
|
+
style?: StyleProp<ViewStyle>;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* R14 — the input's own props, the wrapper `View`'s, and every `ViewStyle` key neither
|
|
79
|
+
* already claims. **`TextInputProps` are not here**: they belong to `Input.Field`, which
|
|
80
|
+
* is the node that has them.
|
|
81
|
+
*/
|
|
82
|
+
type InputProps = InputOwnProps & Omit<ViewProps, keyof InputOwnProps> & Omit<ViewStyleProps, keyof InputOwnProps | keyof ViewProps> & {
|
|
83
|
+
/** R12 — merge into the single child instead of rendering a `View`. */
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Everything `TextInput` accepts, plus the `TextStyle` keys as props (R14).
|
|
88
|
+
*
|
|
89
|
+
* `editable` is absent: it is `disabled` under another name, and R8 keeps that off the
|
|
90
|
+
* public surface — `isDisabled` on the root is what stops the field.
|
|
91
|
+
*/
|
|
92
|
+
type InputFieldProps = Omit<TextInputProps, 'editable'> & Omit<TextStyleProps, keyof TextInputProps>;
|
|
93
|
+
/** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
|
|
94
|
+
type InputTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
};
|
|
97
|
+
type InputLabelProps = InputTextProps;
|
|
98
|
+
type InputDescriptionProps = InputTextProps;
|
|
99
|
+
type InputErrorProps = InputTextProps;
|
|
100
|
+
/**
|
|
101
|
+
* Read off `TextInput`'s own props rather than spelled out: React Native has renamed the
|
|
102
|
+
* payload of these two more than once, and a hand-written `NativeSyntheticEvent<…>` here
|
|
103
|
+
* would be a second declaration free to drift from the node that actually fires them.
|
|
104
|
+
*/
|
|
105
|
+
type FieldFocusEvent = Parameters<NonNullable<TextInputProps['onFocus']>>[0];
|
|
106
|
+
type FieldBlurEvent = Parameters<NonNullable<TextInputProps['onBlur']>>[0];
|
|
107
|
+
/**
|
|
108
|
+
* R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
|
|
109
|
+
* cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
|
|
110
|
+
* merges its own `style` on top and does no work of its own.
|
|
111
|
+
*/
|
|
112
|
+
type InputContextValue = {
|
|
113
|
+
labelStyle: StyleProp<TextStyle>;
|
|
114
|
+
fieldStyle: StyleProp<TextStyle>;
|
|
115
|
+
/** Layered *over* `fieldStyle` by `Input.TextArea`: only what a multiline field adds. */
|
|
116
|
+
textAreaStyle: StyleProp<TextStyle>;
|
|
117
|
+
/**
|
|
118
|
+
* Values, not a style: `rows` is a raw number, so the height it implies is arithmetic
|
|
119
|
+
* the slot does — and these are the two measurements it needs, flattened once here
|
|
120
|
+
* rather than in every text area on the screen.
|
|
121
|
+
*/
|
|
122
|
+
textArea: {
|
|
123
|
+
lineHeight: number;
|
|
124
|
+
paddingVertical: number;
|
|
125
|
+
};
|
|
126
|
+
descriptionStyle: StyleProp<TextStyle>;
|
|
127
|
+
errorStyle: StyleProp<TextStyle>;
|
|
128
|
+
/**
|
|
129
|
+
* The two decorators of an `InputGroup`, already pinned to their edge and inset by the
|
|
130
|
+
* field's own padding. They are resolved here, on the root, because the size that
|
|
131
|
+
* decides that padding is the root's — the group itself adds no axis of its own.
|
|
132
|
+
*/
|
|
133
|
+
prefixStyle: StyleProp<ViewStyle>;
|
|
134
|
+
suffixStyle: StyleProp<ViewStyle>;
|
|
135
|
+
/**
|
|
136
|
+
* Values, not a style: an icon is a third party's component, and `size` and `color` are
|
|
137
|
+
* props it takes rather than a style it accepts. Flattened once here, the way the `Chip`
|
|
138
|
+
* and the `Alert` publish theirs.
|
|
139
|
+
*/
|
|
140
|
+
icon: {
|
|
141
|
+
size: number | undefined;
|
|
142
|
+
color: string | undefined;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* A value and not a style: `placeholderTextColor` is a `TextInput` prop, so the root
|
|
146
|
+
* flattens its placeholder slot once here rather than in the field.
|
|
147
|
+
*/
|
|
148
|
+
placeholderTextColor?: string;
|
|
149
|
+
/**
|
|
150
|
+
* The focus state lives on the **root**, because the root's recipe resolves on it (R5)
|
|
151
|
+
* and it needs the value before it renders — but the node that hears the event is
|
|
152
|
+
* `Input.Field`, three levels down. These are how it reports back. Their identity is
|
|
153
|
+
* stable, so publishing them costs no re-render of a memoized slot.
|
|
154
|
+
*/
|
|
155
|
+
onFieldFocus: (event: FieldFocusEvent) => void;
|
|
156
|
+
onFieldBlur: (event: FieldBlurEvent) => void;
|
|
157
|
+
/**
|
|
158
|
+
* The id the label carries and the field points at, so a screen reader reads "Courriel,
|
|
159
|
+
* champ de saisie" rather than just the placeholder.
|
|
160
|
+
*/
|
|
161
|
+
labelId: string;
|
|
162
|
+
descriptionId: string;
|
|
163
|
+
isDisabled: boolean;
|
|
164
|
+
isInvalid: boolean;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type { InputFieldProps as I, InputProps as a, InputContextValue as b, InputDescriptionProps as c, InputErrorProps as d, InputLabelPlacement as e, InputLabelProps as f, InputSize as g, InputSlot as h, InputVariant as i };
|