@webority-technologies/mobile 0.0.22 → 0.0.23
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/lib/commonjs/components/Accordion/Accordion.js +4 -2
- package/lib/commonjs/components/Avatar/Avatar.js +4 -2
- package/lib/commonjs/components/Badge/Badge.js +5 -5
- package/lib/commonjs/components/Banner/Banner.js +8 -4
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +6 -4
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +8 -9
- package/lib/commonjs/components/Box/Box.js +162 -0
- package/lib/commonjs/components/Box/index.js +37 -0
- package/lib/commonjs/components/Button/Button.js +7 -7
- package/lib/commonjs/components/Carousel/Carousel.js +4 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +14 -5
- package/lib/commonjs/components/DatePicker/DatePicker.js +9 -7
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +5 -2
- package/lib/commonjs/components/Dialog/Dialog.js +2 -2
- package/lib/commonjs/components/FieldBase/FieldBase.js +8 -4
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +13 -5
- package/lib/commonjs/components/FormField/FormField.js +61 -25
- package/lib/commonjs/components/Input/Input.js +41 -29
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +102 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
- package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
- package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
- package/lib/commonjs/components/Modal/Modal.js +17 -6
- package/lib/commonjs/components/NumberInput/NumberInput.js +35 -28
- package/lib/commonjs/components/OTPInput/OTPInput.js +33 -18
- package/lib/commonjs/components/Radio/Radio.js +7 -5
- package/lib/commonjs/components/Radio/RadioGroup.js +10 -3
- package/lib/commonjs/components/SearchBar/SearchBar.js +4 -2
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +20 -10
- package/lib/commonjs/components/Select/Select.js +33 -32
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +5 -2
- package/lib/commonjs/components/Slider/Slider.js +42 -26
- package/lib/commonjs/components/Spinner/Spinner.js +5 -5
- package/lib/commonjs/components/Switch/Switch.js +29 -16
- package/lib/commonjs/components/Tabs/Tabs.js +4 -2
- package/lib/commonjs/components/Text/Text.js +142 -0
- package/lib/commonjs/components/Text/index.js +13 -0
- package/lib/commonjs/components/TimePicker/TimePicker.js +10 -7
- package/lib/commonjs/components/Toast/Toast.js +22 -10
- package/lib/commonjs/components/Tooltip/Tooltip.js +6 -2
- package/lib/commonjs/components/index.js +135 -89
- package/lib/commonjs/form/FormContext.js +40 -0
- package/lib/commonjs/form/index.js +68 -0
- package/lib/commonjs/form/path.js +79 -0
- package/lib/commonjs/form/rules.js +67 -0
- package/lib/commonjs/form/types.js +2 -0
- package/lib/commonjs/form/useField.js +54 -0
- package/lib/commonjs/form/useForm.js +316 -0
- package/lib/commonjs/hooks/index.js +14 -0
- package/lib/commonjs/hooks/useControllableState.js +30 -0
- package/lib/commonjs/hooks/useReducedMotion.js +31 -0
- package/lib/commonjs/index.js +96 -11
- package/lib/commonjs/theme/ThemeContext.js +30 -2
- package/lib/commonjs/theme/tokens.js +12 -0
- package/lib/module/components/Accordion/Accordion.js +4 -2
- package/lib/module/components/Avatar/Avatar.js +4 -2
- package/lib/module/components/Badge/Badge.js +5 -5
- package/lib/module/components/Banner/Banner.js +8 -4
- package/lib/module/components/BottomNavigation/BottomNavigation.js +6 -4
- package/lib/module/components/BottomSheet/BottomSheet.js +8 -9
- package/lib/module/components/Box/Box.js +156 -0
- package/lib/module/components/Box/index.js +4 -0
- package/lib/module/components/Button/Button.js +7 -7
- package/lib/module/components/Carousel/Carousel.js +4 -2
- package/lib/module/components/Checkbox/Checkbox.js +14 -5
- package/lib/module/components/DatePicker/DatePicker.js +9 -7
- package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -2
- package/lib/module/components/Dialog/Dialog.js +2 -2
- package/lib/module/components/FieldBase/FieldBase.js +8 -4
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +13 -5
- package/lib/module/components/FormField/FormField.js +62 -26
- package/lib/module/components/Input/Input.js +41 -29
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +98 -0
- package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
- package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +125 -0
- package/lib/module/components/KeyboardToolbar/index.js +4 -0
- package/lib/module/components/Modal/Modal.js +17 -6
- package/lib/module/components/NumberInput/NumberInput.js +30 -23
- package/lib/module/components/OTPInput/OTPInput.js +30 -15
- package/lib/module/components/Radio/Radio.js +7 -5
- package/lib/module/components/Radio/RadioGroup.js +10 -3
- package/lib/module/components/SearchBar/SearchBar.js +4 -2
- package/lib/module/components/SegmentedControl/SegmentedControl.js +20 -10
- package/lib/module/components/Select/Select.js +33 -32
- package/lib/module/components/Skeleton/SkeletonContent.js +5 -2
- package/lib/module/components/Slider/Slider.js +42 -26
- package/lib/module/components/Spinner/Spinner.js +5 -5
- package/lib/module/components/Switch/Switch.js +29 -16
- package/lib/module/components/Tabs/Tabs.js +4 -2
- package/lib/module/components/Text/Text.js +138 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/TimePicker/TimePicker.js +10 -7
- package/lib/module/components/Toast/Toast.js +22 -10
- package/lib/module/components/Tooltip/Tooltip.js +6 -2
- package/lib/module/components/index.js +4 -0
- package/lib/module/form/FormContext.js +32 -0
- package/lib/module/form/index.js +12 -0
- package/lib/module/form/path.js +72 -0
- package/lib/module/form/rules.js +52 -0
- package/lib/module/form/types.js +2 -0
- package/lib/module/form/useField.js +49 -0
- package/lib/module/form/useForm.js +312 -0
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/useControllableState.js +26 -0
- package/lib/module/hooks/useReducedMotion.js +27 -0
- package/lib/module/index.js +3 -1
- package/lib/module/theme/ThemeContext.js +30 -2
- package/lib/module/theme/tokens.js +12 -0
- package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/typescript/commonjs/components/Box/Box.d.ts +60 -0
- package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -1
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +3 -2
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +3 -3
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +2 -2
- package/lib/typescript/commonjs/components/FormField/FormField.d.ts +13 -2
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -2
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +3 -2
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -2
- package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +3 -2
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -2
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +6 -4
- package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +1 -1
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +3 -2
- package/lib/typescript/commonjs/components/Text/Text.d.ts +25 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +3 -3
- package/lib/typescript/commonjs/components/index.d.ts +8 -0
- package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
- package/lib/typescript/commonjs/form/index.d.ts +9 -0
- package/lib/typescript/commonjs/form/path.d.ts +10 -0
- package/lib/typescript/commonjs/form/rules.d.ts +31 -0
- package/lib/typescript/commonjs/form/types.d.ts +94 -0
- package/lib/typescript/commonjs/form/useField.d.ts +27 -0
- package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
- package/lib/typescript/commonjs/hooks/index.d.ts +3 -0
- package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts +4 -2
- package/lib/typescript/commonjs/theme/types.d.ts +15 -0
- package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/typescript/module/components/Box/Box.d.ts +60 -0
- package/lib/typescript/module/components/Box/index.d.ts +3 -0
- package/lib/typescript/module/components/Button/Button.d.ts +1 -1
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +3 -2
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +3 -3
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +2 -2
- package/lib/typescript/module/components/FormField/FormField.d.ts +13 -2
- package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -0
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -2
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +3 -2
- package/lib/typescript/module/components/Radio/Radio.d.ts +2 -2
- package/lib/typescript/module/components/Radio/RadioGroup.d.ts +3 -2
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -2
- package/lib/typescript/module/components/Slider/Slider.d.ts +6 -4
- package/lib/typescript/module/components/Spinner/Spinner.d.ts +1 -1
- package/lib/typescript/module/components/Switch/Switch.d.ts +3 -2
- package/lib/typescript/module/components/Text/Text.d.ts +25 -0
- package/lib/typescript/module/components/Text/index.d.ts +3 -0
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +3 -3
- package/lib/typescript/module/components/index.d.ts +8 -0
- package/lib/typescript/module/form/FormContext.d.ts +17 -0
- package/lib/typescript/module/form/index.d.ts +9 -0
- package/lib/typescript/module/form/path.d.ts +10 -0
- package/lib/typescript/module/form/rules.d.ts +31 -0
- package/lib/typescript/module/form/types.d.ts +94 -0
- package/lib/typescript/module/form/useField.d.ts +27 -0
- package/lib/typescript/module/form/useForm.d.ts +10 -0
- package/lib/typescript/module/hooks/index.d.ts +3 -0
- package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/module/index.d.ts +4 -2
- package/lib/typescript/module/theme/types.d.ts +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type FormValues = Record<string, unknown>;
|
|
2
|
+
export type FormErrors = Record<string, string | undefined>;
|
|
3
|
+
export type FormTouched = Record<string, boolean>;
|
|
4
|
+
export type ValidationResult = string | undefined | null | false;
|
|
5
|
+
/**
|
|
6
|
+
* A single validation rule. Receives the field value and the whole values
|
|
7
|
+
* object (so cross-field rules work). Return an error message string when
|
|
8
|
+
* invalid, or any falsy value when valid. May be async — return a Promise for
|
|
9
|
+
* server-side checks ("is this email already registered?").
|
|
10
|
+
*/
|
|
11
|
+
export type ValidationRule<V = any, Values extends FormValues = FormValues> = (value: V, allValues: Values) => ValidationResult | Promise<ValidationResult>;
|
|
12
|
+
export type FieldRules<V = any, Values extends FormValues = FormValues> = ValidationRule<V, Values> | ValidationRule<V, Values>[];
|
|
13
|
+
/** Per-field rule map keyed by field path (e.g. `{ email: [rules.required(), rules.email()] }`). */
|
|
14
|
+
export type ValidationSchema<Values extends FormValues = FormValues> = Record<string, FieldRules<any, Values>>;
|
|
15
|
+
/** Form-level validate function returning an errors map keyed by field path. */
|
|
16
|
+
export type FormValidateFn<Values extends FormValues = FormValues> = (values: Values) => FormErrors | Promise<FormErrors>;
|
|
17
|
+
export type ValidateOn = 'change' | 'blur' | 'submit';
|
|
18
|
+
export interface SubmitHelpers<Values extends FormValues = FormValues> {
|
|
19
|
+
setErrors: (errors: FormErrors) => void;
|
|
20
|
+
setFieldError: (name: string, error?: string) => void;
|
|
21
|
+
reset: (nextValues?: Partial<Values>) => void;
|
|
22
|
+
setSubmitting: (submitting: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface FormConfig<Values extends FormValues = FormValues> {
|
|
25
|
+
initialValues: Values;
|
|
26
|
+
/** Either a per-field rule map or a single form-level validate function. */
|
|
27
|
+
validate?: ValidationSchema<Values> | FormValidateFn<Values>;
|
|
28
|
+
/** When validation first runs for a field. Library default: 'submit'. */
|
|
29
|
+
validateOn?: ValidateOn;
|
|
30
|
+
/** After a field has surfaced an error once, how it re-validates. Library default: 'change'. */
|
|
31
|
+
revalidateOn?: 'change' | 'blur';
|
|
32
|
+
onSubmit: (values: Values, helpers: SubmitHelpers<Values>) => void | Promise<void>;
|
|
33
|
+
/** Re-initialise values when `initialValues` changes (e.g. async-loaded edit form). Default: false. */
|
|
34
|
+
enableReinitialize?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface FieldState<V = unknown> {
|
|
37
|
+
value: V;
|
|
38
|
+
/** Error the UI should show (gated by touched / submit). */
|
|
39
|
+
error: string | undefined;
|
|
40
|
+
/** Error regardless of touched — useful for `isValid`-style logic. */
|
|
41
|
+
rawError: string | undefined;
|
|
42
|
+
touched: boolean;
|
|
43
|
+
dirty: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Props an input needs to bind to a form field. Covers text and non-text controls. */
|
|
46
|
+
export interface FieldInputProps<V = unknown> {
|
|
47
|
+
name: string;
|
|
48
|
+
value: V;
|
|
49
|
+
error: string | undefined;
|
|
50
|
+
touched: boolean;
|
|
51
|
+
/** Generic change handler (Select/Switch/DatePicker/Slider…). */
|
|
52
|
+
onChange: (value: V) => void;
|
|
53
|
+
/** Text-input alias of `onChange` (TextInput's `onChangeText`). */
|
|
54
|
+
onChangeText: (text: string) => void;
|
|
55
|
+
onBlur: () => void;
|
|
56
|
+
/** Marks this field as the focused one (drives KeyboardToolbar next/prev). */
|
|
57
|
+
onFocus: () => void;
|
|
58
|
+
setValue: (value: V, shouldValidate?: boolean) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface FocusableNode {
|
|
61
|
+
focus?: () => void;
|
|
62
|
+
measureInWindow?: (cb: (x: number, y: number, w: number, h: number) => void) => void;
|
|
63
|
+
}
|
|
64
|
+
export interface FormApi<Values extends FormValues = FormValues> {
|
|
65
|
+
values: Values;
|
|
66
|
+
/** Touched/submit-gated errors — what the UI shows. */
|
|
67
|
+
errors: FormErrors;
|
|
68
|
+
/** Every current error regardless of touched. */
|
|
69
|
+
rawErrors: FormErrors;
|
|
70
|
+
touched: FormTouched;
|
|
71
|
+
dirty: boolean;
|
|
72
|
+
isValid: boolean;
|
|
73
|
+
isSubmitting: boolean;
|
|
74
|
+
isValidating: boolean;
|
|
75
|
+
submitCount: number;
|
|
76
|
+
setFieldValue: (name: string, value: unknown, shouldValidate?: boolean) => void;
|
|
77
|
+
setFieldTouched: (name: string, touched?: boolean, shouldValidate?: boolean) => void;
|
|
78
|
+
setFieldError: (name: string, error?: string) => void;
|
|
79
|
+
setValues: (next: Partial<Values> | ((prev: Values) => Values), shouldValidate?: boolean) => void;
|
|
80
|
+
setErrors: (errors: FormErrors) => void;
|
|
81
|
+
reset: (nextValues?: Partial<Values>) => void;
|
|
82
|
+
validate: () => Promise<FormErrors>;
|
|
83
|
+
validateField: (name: string) => Promise<string | undefined>;
|
|
84
|
+
submit: () => void;
|
|
85
|
+
getFieldState: (name: string) => FieldState;
|
|
86
|
+
getFieldProps: (name: string) => FieldInputProps;
|
|
87
|
+
handleBlur: (name: string) => void;
|
|
88
|
+
/** Move focus to the next / previous registered field (used by KeyboardToolbar). */
|
|
89
|
+
focusNext: () => void;
|
|
90
|
+
focusPrev: () => void;
|
|
91
|
+
/** Registers a focusable node so a failed submit can focus the first error. */
|
|
92
|
+
registerField: (name: string, node: FocusableNode | null) => void;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FieldInputProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Bind a single field by name. Returns everything an input needs; pick the
|
|
4
|
+
* handler your control uses:
|
|
5
|
+
* const email = useField('email');
|
|
6
|
+
* <Input value={email.value} onChangeText={email.onChangeText} onBlur={email.onBlur} error={email.error} />
|
|
7
|
+
* <Select value={country.value} onChange={country.onChange} error={country.error} />
|
|
8
|
+
* <Switch value={!!agree.value} onChange={agree.onChange} />
|
|
9
|
+
*/
|
|
10
|
+
export declare function useField<V = unknown>(name: string): FieldInputProps<V>;
|
|
11
|
+
export interface FieldArrayApi<T = unknown> {
|
|
12
|
+
/** Current array value (empty array when unset). */
|
|
13
|
+
fields: T[];
|
|
14
|
+
length: number;
|
|
15
|
+
push: (item: T) => void;
|
|
16
|
+
remove: (index: number) => void;
|
|
17
|
+
insert: (index: number, item: T) => void;
|
|
18
|
+
move: (from: number, to: number) => void;
|
|
19
|
+
replace: (index: number, item: T) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Manage a repeating list field (phone numbers, line items, etc.) by name.
|
|
23
|
+
* Each helper writes the whole array back through the form so validation and
|
|
24
|
+
* dirty-tracking stay correct.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useFieldArray<T = unknown>(name: string): FieldArrayApi<T>;
|
|
27
|
+
//# sourceMappingURL=useField.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FormApi, FormConfig, FormValues } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Dependency-free form engine. Tracks values/errors/touched/dirty, runs
|
|
4
|
+
* synchronous and async validation (per-field rule maps or a form-level
|
|
5
|
+
* function), gates error display behind touched/submit, and on a failed submit
|
|
6
|
+
* focuses the first errored field. The returned object is rebuilt every render
|
|
7
|
+
* so `<Form>` consumers re-render on state changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useForm<Values extends FormValues = FormValues>(config: FormConfig<Values>): FormApi<Values>;
|
|
10
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -3,4 +3,7 @@ export type { UseToggleResult } from './useToggle';
|
|
|
3
3
|
export { useDebounce } from './useDebounce';
|
|
4
4
|
export { usePressAnimation } from './usePressAnimation';
|
|
5
5
|
export type { UsePressAnimationOptions, UsePressAnimationResult } from './usePressAnimation';
|
|
6
|
+
export { useReducedMotion } from './useReducedMotion';
|
|
7
|
+
export { useControllableState } from './useControllableState';
|
|
8
|
+
export type { UseControllableStateOptions } from './useControllableState';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface UseControllableStateOptions<T> {
|
|
2
|
+
/** Controlled value. When `undefined`, the hook manages state internally. */
|
|
3
|
+
value?: T;
|
|
4
|
+
/** Initial value used in uncontrolled mode. */
|
|
5
|
+
defaultValue: T;
|
|
6
|
+
/** Called on every change (both modes). */
|
|
7
|
+
onChange?: (value: T) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Bridges controlled and uncontrolled usage for a value+onChange pair. When
|
|
11
|
+
* `value` is provided the component is controlled (the hook just forwards it
|
|
12
|
+
* and calls `onChange`); otherwise the hook owns the state, seeded from
|
|
13
|
+
* `defaultValue`. The controlled/uncontrolled decision is locked on first
|
|
14
|
+
* render so a component never flips modes mid-life.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useControllableState<T>({ value, defaultValue, onChange }: UseControllableStateOptions<T>): [T, (next: T) => void];
|
|
17
|
+
//# sourceMappingURL=useControllableState.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks the OS "Reduce Motion" accessibility setting. The library's
|
|
3
|
+
* ThemeProvider uses this to collapse `theme.motion` (durations → 0, springs →
|
|
4
|
+
* near-instant) so animations don't trigger vestibular discomfort; consumers
|
|
5
|
+
* can also read it directly to swap an animated path for a static one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useReducedMotion: () => boolean;
|
|
8
|
+
//# sourceMappingURL=useReducedMotion.d.ts.map
|
|
@@ -21,14 +21,16 @@ export { VersionCheck, useVersionCheck } from './versionCheck';
|
|
|
21
21
|
export type { UpdateInfo, UpdateType, VersionData, VersionComparison, VersionCheckResult, VersionCheckType, ParsedVersion, Platform } from './versionCheck';
|
|
22
22
|
export { ThemeProvider, useTheme, useThemeMode, setTheme, setColorMode, getColorMode, getTheme, resetTheme, subscribeTheme, mergeTheme, lightTheme, darkTheme } from './theme';
|
|
23
23
|
export type { Theme, ThemeOverrides, ThemeProviderProps, IconRegistry, IconRenderer, ColorMode, ColorPalette, ColorSchemePreference, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, TypographyScale, MotionScale, DeepPartial } from './theme';
|
|
24
|
-
export { useToggle, useDebounce, usePressAnimation } from './hooks';
|
|
25
|
-
export type { UseToggleResult, UsePressAnimationOptions, UsePressAnimationResult } from './hooks';
|
|
24
|
+
export { useToggle, useDebounce, usePressAnimation, useReducedMotion, useControllableState } from './hooks';
|
|
25
|
+
export type { UseToggleResult, UsePressAnimationOptions, UsePressAnimationResult, UseControllableStateOptions } from './hooks';
|
|
26
26
|
export { ScreenDimensions, Breakpoints, Responsive, isScreenSize, isTablet, Spacing, Padding, Margin, triggerHaptic, setHapticImplementation, shadowStyle, compressImage } from './utils';
|
|
27
27
|
export type { BreakpointKey, SpacingToken, HapticType, CompressImageOptions } from './utils';
|
|
28
28
|
export { formatDate, formatTime, formatDateTime, formatRelativeTime, formatPhone, normalizePhone, formatCurrency, formatNumber, formatPercent, formatCompactNumber, getInitials } from './formatters';
|
|
29
29
|
export type { DateInput, DateStyle, TimeStyle, FormatCurrencyOptions } from './formatters';
|
|
30
30
|
export { isNonEmpty, isEmail, isIndianMobile, isPhone, isUrl, isNumeric, isInteger, isAlphanumeric, isStrongPassword, isIndianPincode, isPan, isGstin, isAadhaar, isIfsc, isHexColor, isBetween, minLength, maxLength } from './validators';
|
|
31
31
|
export type { PasswordRules } from './validators';
|
|
32
|
+
export { useForm, useField, useFieldArray, Form, useFormContext, useOptionalFormContext, rules, getPath, setPath, deletePath } from './form';
|
|
33
|
+
export type { FormApi, FormConfig, FormValues, FormErrors, FormTouched, FieldState, FieldInputProps, FocusableNode, ValidationRule, ValidationResult, FieldRules, ValidationSchema, FormValidateFn, ValidateOn, SubmitHelpers, FieldArrayApi } from './form';
|
|
32
34
|
export { useNetworkStatus, getNetworkStatus, addNetworkStatusListener, NetworkStatusBanner } from './network';
|
|
33
35
|
export type { NetworkStatus, NetworkConnectionType, NetworkStatusListener, NetworkStatusBannerProps } from './network';
|
|
34
36
|
export { Permissions } from './permissions';
|
|
@@ -39,6 +39,21 @@ export interface ColorPalette {
|
|
|
39
39
|
warning: string;
|
|
40
40
|
error: string;
|
|
41
41
|
info: string;
|
|
42
|
+
/**
|
|
43
|
+
* Foreground (text/icon) colour to render ON a solid fill of each semantic
|
|
44
|
+
* tone. Solid Button / Badge / Chip / Banner backgrounds read these instead
|
|
45
|
+
* of assuming `text.inverse` (white) — white-on-pale (notably `warning`
|
|
46
|
+
* amber) fails contrast. Library defaults keep the historical white for
|
|
47
|
+
* primary/success/error/info, use dark ink for `warning`, and `text.primary`
|
|
48
|
+
* for the surface-like `secondary` tone. Override per-brand to match your
|
|
49
|
+
* palette's luminance.
|
|
50
|
+
*/
|
|
51
|
+
onPrimary: string;
|
|
52
|
+
onSecondary: string;
|
|
53
|
+
onSuccess: string;
|
|
54
|
+
onWarning: string;
|
|
55
|
+
onError: string;
|
|
56
|
+
onInfo: string;
|
|
42
57
|
text: {
|
|
43
58
|
primary: string;
|
|
44
59
|
secondary: string;
|
|
@@ -20,7 +20,7 @@ export interface TabConfig {
|
|
|
20
20
|
export interface BottomNavigationProps {
|
|
21
21
|
tabs: TabConfig[];
|
|
22
22
|
activeTab: string;
|
|
23
|
-
|
|
23
|
+
onChange: (tabKey: string) => void;
|
|
24
24
|
haptic?: HapticType | false;
|
|
25
25
|
showLabels?: boolean;
|
|
26
26
|
variant?: BottomNavigationVariant;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
4
|
+
import type { ColorPalette, RadiusScale, SpacingScale, Theme } from '../../theme/types';
|
|
5
|
+
export type SpacingToken = keyof SpacingScale;
|
|
6
|
+
export type RadiusToken = keyof RadiusScale;
|
|
7
|
+
export type BackgroundToken = keyof ColorPalette['background'];
|
|
8
|
+
export interface BoxProps extends ViewProps {
|
|
9
|
+
/** padding (all sides) */
|
|
10
|
+
p?: SpacingToken;
|
|
11
|
+
/** paddingHorizontal */
|
|
12
|
+
px?: SpacingToken;
|
|
13
|
+
/** paddingVertical */
|
|
14
|
+
py?: SpacingToken;
|
|
15
|
+
pt?: SpacingToken;
|
|
16
|
+
pr?: SpacingToken;
|
|
17
|
+
pb?: SpacingToken;
|
|
18
|
+
pl?: SpacingToken;
|
|
19
|
+
/** margin (all sides) */
|
|
20
|
+
m?: SpacingToken;
|
|
21
|
+
mx?: SpacingToken;
|
|
22
|
+
my?: SpacingToken;
|
|
23
|
+
mt?: SpacingToken;
|
|
24
|
+
mr?: SpacingToken;
|
|
25
|
+
mb?: SpacingToken;
|
|
26
|
+
ml?: SpacingToken;
|
|
27
|
+
/** Flexbox gap between children (spacing token). */
|
|
28
|
+
gap?: SpacingToken;
|
|
29
|
+
/** Background — a `colors.background.*` token or a raw colour string. */
|
|
30
|
+
bg?: BackgroundToken | (string & {});
|
|
31
|
+
radius?: RadiusToken;
|
|
32
|
+
/** Draw a hairline border in `colors.border.primary`. */
|
|
33
|
+
border?: boolean;
|
|
34
|
+
flex?: number;
|
|
35
|
+
align?: ViewStyle['alignItems'];
|
|
36
|
+
justify?: ViewStyle['justifyContent'];
|
|
37
|
+
direction?: ViewStyle['flexDirection'];
|
|
38
|
+
wrap?: boolean;
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
|
+
}
|
|
41
|
+
type LayoutProps = Omit<BoxProps, 'style' | 'children'>;
|
|
42
|
+
export declare const resolveBoxStyle: (theme: Theme, p: LayoutProps) => ViewStyle;
|
|
43
|
+
declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<View>>;
|
|
44
|
+
export type StackProps = Omit<BoxProps, 'direction'>;
|
|
45
|
+
/** Vertical flex container with token spacing between children (default gap `md`). */
|
|
46
|
+
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<View>>;
|
|
47
|
+
export type RowProps = Omit<BoxProps, 'direction'>;
|
|
48
|
+
/** Horizontal flex container (default `align="center"`, gap `sm`). */
|
|
49
|
+
declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<View>>;
|
|
50
|
+
export interface SpacerProps {
|
|
51
|
+
/** Fixed spacer of this spacing token. Omit for a flexible spacer (`flex: 1`). */
|
|
52
|
+
size?: SpacingToken;
|
|
53
|
+
style?: StyleProp<ViewStyle>;
|
|
54
|
+
testID?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Fixed gap (`size`) or a flexible push (`flex: 1`) between siblings. */
|
|
57
|
+
declare const Spacer: React.FC<SpacerProps>;
|
|
58
|
+
export { Box, Stack, Row, Spacer };
|
|
59
|
+
export default Box;
|
|
60
|
+
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -4,7 +4,7 @@ import type { PressableProps, StyleProp, TextStyle, ViewStyle } from 'react-nati
|
|
|
4
4
|
import type { GradientDefinition } from '../../theme/types';
|
|
5
5
|
import type { HapticType } from '../../utils/hapticUtils';
|
|
6
6
|
export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';
|
|
7
|
-
export type ButtonTone = 'primary' | 'secondary' | 'success' | 'warning' | '
|
|
7
|
+
export type ButtonTone = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral';
|
|
8
8
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
9
|
export interface ButtonProps extends Omit<PressableProps, 'style' | 'children'> {
|
|
10
10
|
title?: string;
|
|
@@ -5,8 +5,9 @@ import type { HapticType } from '../../utils/hapticUtils';
|
|
|
5
5
|
export type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
export type CheckboxTone = 'primary' | 'success' | 'warning' | 'error';
|
|
7
7
|
export interface CheckboxProps extends Omit<PressableProps, 'style' | 'children' | 'onPress'> {
|
|
8
|
-
checked
|
|
9
|
-
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
defaultChecked?: boolean;
|
|
10
|
+
onChange?: (checked: boolean) => void;
|
|
10
11
|
indeterminate?: boolean;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
label?: string;
|
|
@@ -6,21 +6,21 @@ export type WeekStart = 0 | 1 | 6;
|
|
|
6
6
|
/**
|
|
7
7
|
* DatePicker operates in two modes:
|
|
8
8
|
*
|
|
9
|
-
* 1. **Controlled-modal mode** — pass `visible` (plus `
|
|
9
|
+
* 1. **Controlled-modal mode** — pass `visible` (plus `onChange` / `onClose`)
|
|
10
10
|
* and own the open state externally. The component renders only the modal.
|
|
11
11
|
* 2. **Trigger mode** — omit `visible`. The component renders a built-in
|
|
12
12
|
* PickerTrigger field (label / value / placeholder / chevron / clear /
|
|
13
13
|
* helper / error / size / variant) and manages its own open state. The
|
|
14
14
|
* field opens the modal on press and closes it on confirm/cancel.
|
|
15
15
|
*
|
|
16
|
-
* `
|
|
16
|
+
* `onChange` / `onClose` are typed optional to support trigger-only usage
|
|
17
17
|
* where the consumer may not need either callback. In controlled-modal mode
|
|
18
18
|
* they remain semantically required.
|
|
19
19
|
*/
|
|
20
20
|
export interface DatePickerProps {
|
|
21
21
|
visible?: boolean;
|
|
22
22
|
value?: Date | null;
|
|
23
|
-
|
|
23
|
+
onChange?: (date: Date) => void;
|
|
24
24
|
onClose?: () => void;
|
|
25
25
|
minDate?: Date;
|
|
26
26
|
maxDate?: Date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
export type DialogVariant = 'default' | 'success' | 'warning' | '
|
|
4
|
-
export type DialogActionTone = 'primary' | 'neutral' | '
|
|
3
|
+
export type DialogVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
4
|
+
export type DialogActionTone = 'primary' | 'neutral' | 'error';
|
|
5
5
|
export interface DialogAction {
|
|
6
6
|
label: string;
|
|
7
7
|
onPress: () => void;
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
|
+
import type { FieldInputProps } from '../../form/types';
|
|
4
5
|
export type FormFieldLayout = 'stacked' | 'inline';
|
|
5
6
|
export interface FormFieldProps {
|
|
6
7
|
label?: string;
|
|
7
8
|
helperText?: string;
|
|
8
9
|
/**
|
|
9
10
|
* When truthy: helperText is hidden, error is shown in the error colour,
|
|
10
|
-
* and the container reports
|
|
11
|
+
* and the container reports the invalid state to assistive tech.
|
|
12
|
+
* Ignored when `name` connects to a <Form> with an element child (the child
|
|
13
|
+
* renders its own error then).
|
|
11
14
|
*/
|
|
12
15
|
error?: string;
|
|
13
16
|
/** Appends ' *' (in theme.colors.error) to the label. */
|
|
14
17
|
required?: boolean;
|
|
15
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Connect this field to the surrounding `<Form>` by name. With an element
|
|
20
|
+
* child (e.g. `<Input/>`) the field's value/onChangeText/onBlur/error are
|
|
21
|
+
* injected automatically — best for text inputs. For non-text controls
|
|
22
|
+
* (Select, Switch, DatePicker…) use the render-prop form:
|
|
23
|
+
* `<FormField name="x">{(f) => <Select value={f.value} onChange={f.onChange} />}</FormField>`.
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
26
|
+
children: React.ReactNode | ((field: FieldInputProps) => React.ReactNode);
|
|
16
27
|
/** 'stacked' (default): label above input. 'inline': label left, input right. */
|
|
17
28
|
layout?: FormFieldLayout;
|
|
18
29
|
labelStyle?: StyleProp<TextStyle>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
import type { ScrollViewProps } from 'react-native';
|
|
4
|
+
export interface KeyboardAwareScrollViewProps extends ScrollViewProps {
|
|
5
|
+
/** Gap kept between the focused field and the top of the keyboard. Default 24. */
|
|
6
|
+
extraScrollHeight?: number;
|
|
7
|
+
/** Disable the keyboard-following behaviour (still a normal ScrollView). Default false. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A ScrollView that keeps the focused input visible above the keyboard — no
|
|
12
|
+
* native dependency. On keyboard show it pads the content by the keyboard
|
|
13
|
+
* height and scrolls the focused TextInput so its bottom sits `extraScrollHeight`
|
|
14
|
+
* above the keyboard, but only when it would otherwise be covered (so already-
|
|
15
|
+
* visible fields don't jump). The classic measure-and-scroll approach, in pure RN.
|
|
16
|
+
*/
|
|
17
|
+
declare const KeyboardAwareScrollView: React.ForwardRefExoticComponent<KeyboardAwareScrollViewProps & React.RefAttributes<ScrollView>>;
|
|
18
|
+
export { KeyboardAwareScrollView };
|
|
19
|
+
export default KeyboardAwareScrollView;
|
|
20
|
+
//# sourceMappingURL=KeyboardAwareScrollView.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface KeyboardToolbarProps {
|
|
4
|
+
/** Label for the dismiss button. Default 'Done'. */
|
|
5
|
+
doneLabel?: string;
|
|
6
|
+
/** Show the prev/next chevrons. Default: true when prev/next handlers resolve. */
|
|
7
|
+
showNavigation?: boolean;
|
|
8
|
+
/** Override the dismiss action. Default: `Keyboard.dismiss()`. */
|
|
9
|
+
onDone?: () => void;
|
|
10
|
+
/** Override "next field". Default: the surrounding `<Form>`'s `focusNext`. */
|
|
11
|
+
onNext?: () => void;
|
|
12
|
+
/** Override "previous field". Default: the surrounding `<Form>`'s `focusPrev`. */
|
|
13
|
+
onPrev?: () => void;
|
|
14
|
+
/** Custom content rendered between the nav chevrons and the Done button. */
|
|
15
|
+
leading?: React.ReactNode;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
testID?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An accessory bar pinned just above the keyboard — pure RN, no native
|
|
21
|
+
* dependency. Shows a Done (dismiss) button and optional prev/next chevrons
|
|
22
|
+
* that, inside a `<Form>`, walk the registered field order. Render it at the
|
|
23
|
+
* screen root (a `flex: 1` ancestor) so its `bottom: keyboardHeight` offset
|
|
24
|
+
* lands it on top of the keyboard. Renders nothing while the keyboard is hidden.
|
|
25
|
+
*/
|
|
26
|
+
declare const KeyboardToolbar: React.FC<KeyboardToolbarProps>;
|
|
27
|
+
export { KeyboardToolbar };
|
|
28
|
+
export default KeyboardToolbar;
|
|
29
|
+
//# sourceMappingURL=KeyboardToolbar.d.ts.map
|
|
@@ -8,8 +8,9 @@ export interface NumberInputRef {
|
|
|
8
8
|
clear: () => void;
|
|
9
9
|
}
|
|
10
10
|
export interface NumberInputProps {
|
|
11
|
-
value
|
|
12
|
-
|
|
11
|
+
value?: number;
|
|
12
|
+
defaultValue?: number;
|
|
13
|
+
onChange?: (value: number) => void;
|
|
13
14
|
min?: number;
|
|
14
15
|
max?: number;
|
|
15
16
|
step?: number;
|
|
@@ -7,8 +7,9 @@ export interface OTPInputRef {
|
|
|
7
7
|
clear: () => void;
|
|
8
8
|
}
|
|
9
9
|
export interface OTPInputProps {
|
|
10
|
-
value
|
|
11
|
-
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
12
13
|
onComplete?: (value: string) => void;
|
|
13
14
|
length?: number;
|
|
14
15
|
keyboardType?: 'number-pad' | 'default';
|
|
@@ -7,7 +7,7 @@ export type RadioTone = 'primary' | 'success' | 'warning' | 'error';
|
|
|
7
7
|
export type RadioValue = string | number;
|
|
8
8
|
export interface RadioGroupContextValue {
|
|
9
9
|
selectedValue: RadioValue | undefined;
|
|
10
|
-
|
|
10
|
+
onChange: (value: RadioValue) => void;
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare const RadioGroupContext: React.Context<RadioGroupContextValue | null>;
|
|
@@ -15,7 +15,7 @@ export declare const useRadioGroup: () => RadioGroupContextValue | null;
|
|
|
15
15
|
export interface RadioProps extends Omit<PressableProps, 'style' | 'children' | 'onPress'> {
|
|
16
16
|
value: RadioValue;
|
|
17
17
|
selected?: boolean;
|
|
18
|
-
|
|
18
|
+
onChange?: (value: RadioValue) => void;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
label?: string;
|
|
21
21
|
size?: RadioSize;
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import type { RadioValue } from './Radio';
|
|
4
4
|
export interface RadioGroupProps {
|
|
5
|
-
value
|
|
6
|
-
|
|
5
|
+
value?: RadioValue;
|
|
6
|
+
defaultValue?: RadioValue;
|
|
7
|
+
onChange?: (value: RadioValue) => void;
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
accessibilityLabel?: string;
|
|
@@ -18,8 +18,9 @@ export interface SegmentItem {
|
|
|
18
18
|
}
|
|
19
19
|
export interface SegmentedControlProps {
|
|
20
20
|
segments: SegmentItem[];
|
|
21
|
-
value
|
|
22
|
-
|
|
21
|
+
value?: SegmentValue;
|
|
22
|
+
defaultValue?: SegmentValue;
|
|
23
|
+
onChange?: (value: SegmentValue) => void;
|
|
23
24
|
size?: SegmentedControlSize;
|
|
24
25
|
fullWidth?: boolean;
|
|
25
26
|
disabled?: boolean;
|
|
@@ -29,13 +29,15 @@ interface SliderCommonProps {
|
|
|
29
29
|
}
|
|
30
30
|
interface SliderSingleProps extends SliderCommonProps {
|
|
31
31
|
range?: false;
|
|
32
|
-
value
|
|
33
|
-
|
|
32
|
+
value?: number;
|
|
33
|
+
defaultValue?: number;
|
|
34
|
+
onChange?: (value: number) => void;
|
|
34
35
|
}
|
|
35
36
|
interface SliderRangeProps extends SliderCommonProps {
|
|
36
37
|
range: true;
|
|
37
|
-
value
|
|
38
|
-
|
|
38
|
+
value?: [number, number];
|
|
39
|
+
defaultValue?: [number, number];
|
|
40
|
+
onChange?: (value: [number, number]) => void;
|
|
39
41
|
}
|
|
40
42
|
export type SliderProps = SliderSingleProps | SliderRangeProps;
|
|
41
43
|
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<View>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
export type SpinnerSize = '
|
|
4
|
+
export type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
export type SpinnerVariant = 'circular' | 'dots';
|
|
6
6
|
export interface SpinnerProps {
|
|
7
7
|
size?: SpinnerSize;
|
|
@@ -5,8 +5,9 @@ import type { HapticType } from '../../utils/hapticUtils';
|
|
|
5
5
|
export type SwitchSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
export type SwitchTone = 'primary' | 'success' | 'warning' | 'error';
|
|
7
7
|
export interface SwitchProps extends Omit<PressableProps, 'style' | 'children' | 'onPress'> {
|
|
8
|
-
value
|
|
9
|
-
|
|
8
|
+
value?: boolean;
|
|
9
|
+
defaultValue?: boolean;
|
|
10
|
+
onChange?: (value: boolean) => void;
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
size?: SwitchSize;
|
|
12
13
|
tone?: SwitchTone;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text as RNText } from 'react-native';
|
|
3
|
+
import type { StyleProp, TextProps as RNTextProps, TextStyle } from 'react-native';
|
|
4
|
+
import type { FontWeightKey } from '../../theme';
|
|
5
|
+
import type { TypographyScale } from '../../theme/types';
|
|
6
|
+
export type TextVariant = 'display' | 'h1' | 'h2' | 'h3' | 'title' | 'body' | 'bodySmall' | 'caption' | 'label' | 'overline';
|
|
7
|
+
export type TextColor = 'primary' | 'secondary' | 'tertiary' | 'inverse' | 'disabled' | 'link' | 'success' | 'warning' | 'error' | 'info';
|
|
8
|
+
export interface TextProps extends Omit<RNTextProps, 'style'> {
|
|
9
|
+
variant?: TextVariant;
|
|
10
|
+
/** Text role token, semantic tone, or a raw colour string. Defaults per variant. */
|
|
11
|
+
color?: TextColor | (string & {});
|
|
12
|
+
/** Override the variant's weight. */
|
|
13
|
+
weight?: FontWeightKey;
|
|
14
|
+
/** Override the variant's size — a typography token or a pixel number. */
|
|
15
|
+
size?: keyof TypographyScale['fontSize'] | number;
|
|
16
|
+
align?: TextStyle['textAlign'];
|
|
17
|
+
italic?: boolean;
|
|
18
|
+
underline?: boolean;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
style?: StyleProp<TextStyle>;
|
|
21
|
+
}
|
|
22
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<RNText>>;
|
|
23
|
+
export { Text };
|
|
24
|
+
export default Text;
|
|
25
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -11,19 +11,19 @@ export interface TimeValue {
|
|
|
11
11
|
/**
|
|
12
12
|
* TimePicker supports two modes:
|
|
13
13
|
*
|
|
14
|
-
* 1. Controlled-modal mode — pass `visible`, `
|
|
14
|
+
* 1. Controlled-modal mode — pass `visible`, `onChange`, `onClose`. The
|
|
15
15
|
* component renders only the modal sheet and the caller owns open/close
|
|
16
16
|
* state plus its own trigger UI.
|
|
17
17
|
* 2. Trigger mode — omit `visible`. The component renders a PickerTrigger
|
|
18
18
|
* field (label / value / placeholder / chevron / clear / helper / error)
|
|
19
|
-
* and manages its own modal open state. `
|
|
19
|
+
* and manages its own modal open state. `onChange` is still called on
|
|
20
20
|
* confirm.
|
|
21
21
|
*/
|
|
22
22
|
export interface TimePickerProps {
|
|
23
23
|
/** Controlled-modal visibility. When omitted, the component enters trigger mode. */
|
|
24
24
|
visible?: boolean;
|
|
25
25
|
value?: TimeValue | null;
|
|
26
|
-
|
|
26
|
+
onChange?: (time: TimeValue) => void;
|
|
27
27
|
onClose?: () => void;
|
|
28
28
|
format?: TimeFormat;
|
|
29
29
|
minuteStep?: MinuteStep;
|
|
@@ -12,6 +12,14 @@ export { BottomSheet, useBottomSheet } from './BottomSheet';
|
|
|
12
12
|
export type { BottomSheetContextValue, BottomSheetProps, BottomSheetRef } from './BottomSheet';
|
|
13
13
|
export { Button } from './Button';
|
|
14
14
|
export type { ButtonProps, ButtonVariant, ButtonTone, ButtonSize } from './Button';
|
|
15
|
+
export { Box, Stack, Row, Spacer } from './Box';
|
|
16
|
+
export type { BoxProps, StackProps, RowProps, SpacerProps } from './Box';
|
|
17
|
+
export { Text } from './Text';
|
|
18
|
+
export type { TextProps, TextVariant, TextColor } from './Text';
|
|
19
|
+
export { KeyboardAwareScrollView } from './KeyboardAwareScrollView';
|
|
20
|
+
export type { KeyboardAwareScrollViewProps } from './KeyboardAwareScrollView';
|
|
21
|
+
export { KeyboardToolbar } from './KeyboardToolbar';
|
|
22
|
+
export type { KeyboardToolbarProps } from './KeyboardToolbar';
|
|
15
23
|
export { Card } from './Card';
|
|
16
24
|
export type { CardProps, CardVariant, CardElevation, CardPadding, CardRadius } from './Card';
|
|
17
25
|
export { Carousel } from './Carousel';
|