@webority-technologies/mobile 0.0.8 → 0.0.10
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 +3 -3
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js +2 -2
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/Carousel/Carousel.js +2 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +8 -8
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +4 -4
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +2 -2
- package/lib/commonjs/components/FormField/FormField.js +1 -1
- package/lib/commonjs/components/Input/Input.js +15 -7
- package/lib/commonjs/components/Modal/Modal.js +4 -4
- package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/commonjs/components/Radio/Radio.js +1 -1
- package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +2 -2
- package/lib/commonjs/components/Select/Select.js +3 -3
- package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +6 -6
- package/lib/commonjs/components/Spinner/Spinner.js +2 -2
- package/lib/commonjs/components/Stepper/Stepper.js +3 -3
- package/lib/commonjs/components/Switch/Switch.js +3 -3
- package/lib/commonjs/components/Tabs/Tabs.js +2 -2
- package/lib/commonjs/components/TimePicker/TimePicker.js +3 -3
- package/lib/commonjs/components/Toast/Toast.js +3 -3
- package/lib/commonjs/components/Tooltip/Tooltip.js +2 -2
- package/lib/commonjs/theme/animatedValue.js +28 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/module/components/Accordion/Accordion.js +4 -4
- package/lib/module/components/Avatar/Avatar.js +2 -2
- package/lib/module/components/Badge/Badge.js +2 -2
- package/lib/module/components/Banner/Banner.js +3 -3
- package/lib/module/components/BottomNavigation/BottomNavigation.js +2 -2
- package/lib/module/components/Carousel/Carousel.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +2 -2
- package/lib/module/components/DatePicker/DatePicker.js +9 -9
- package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -5
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +3 -3
- package/lib/module/components/FormField/FormField.js +2 -2
- package/lib/module/components/Input/Input.js +16 -8
- package/lib/module/components/Modal/Modal.js +5 -5
- package/lib/module/components/OTPInput/OTPInput.js +2 -2
- package/lib/module/components/ProgressBar/ProgressBar.js +3 -3
- package/lib/module/components/Radio/Radio.js +2 -2
- package/lib/module/components/SearchBar/SearchBar.js +2 -2
- package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -3
- package/lib/module/components/Select/Select.js +4 -4
- package/lib/module/components/Skeleton/Skeleton.js +2 -2
- package/lib/module/components/Slider/Slider.js +7 -7
- package/lib/module/components/Spinner/Spinner.js +3 -3
- package/lib/module/components/Stepper/Stepper.js +4 -4
- package/lib/module/components/Switch/Switch.js +4 -4
- package/lib/module/components/Tabs/Tabs.js +3 -3
- package/lib/module/components/TimePicker/TimePicker.js +4 -4
- package/lib/module/components/Toast/Toast.js +4 -4
- package/lib/module/components/Tooltip/Tooltip.js +3 -3
- package/lib/module/theme/animatedValue.js +24 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +10 -0
- package/lib/typescript/commonjs/theme/animatedValue.d.ts +21 -0
- package/lib/typescript/commonjs/theme/index.d.ts +1 -0
- package/lib/typescript/commonjs/theme/types.d.ts +7 -1
- package/lib/typescript/module/components/Input/Input.d.ts +10 -0
- package/lib/typescript/module/theme/animatedValue.d.ts +21 -0
- package/lib/typescript/module/theme/index.d.ts +1 -0
- package/lib/typescript/module/theme/types.d.ts +7 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
import type { BlurEvent, FocusEvent, StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
export type InputSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
export type InputVariant = 'outlined' | 'filled';
|
|
6
|
+
export type InputLabelMode = 'float' | 'top';
|
|
6
7
|
export interface InputProps extends Omit<TextInputProps, 'style'> {
|
|
7
8
|
label?: string;
|
|
8
9
|
placeholder?: string;
|
|
@@ -18,6 +19,15 @@ export interface InputProps extends Omit<TextInputProps, 'style'> {
|
|
|
18
19
|
rightIcon?: React.ReactNode;
|
|
19
20
|
size?: InputSize;
|
|
20
21
|
variant?: InputVariant;
|
|
22
|
+
/**
|
|
23
|
+
* - `'float'` (default): Material-Design floating label that animates from
|
|
24
|
+
* inside the field to the top border on focus / when there's a value.
|
|
25
|
+
* - `'top'`: classic static label rendered above the field with no animation.
|
|
26
|
+
* Use for forms that want the label permanently visible.
|
|
27
|
+
*
|
|
28
|
+
* Theme override: `theme.components.input.defaultLabelMode`.
|
|
29
|
+
*/
|
|
30
|
+
labelMode?: InputLabelMode;
|
|
21
31
|
required?: boolean;
|
|
22
32
|
maxLength?: number;
|
|
23
33
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Create an `Animated.Value` that survives RN 0.85's dev-mode prop deepFreeze.
|
|
4
|
+
*
|
|
5
|
+
* RN's Fabric renderer deep-freezes prop trees on host components. If an
|
|
6
|
+
* `Animated.Value` is reachable from a `style` prop via interpolation chains
|
|
7
|
+
* (the `_parent` ref on `AnimatedInterpolation` nodes), the recursive freeze
|
|
8
|
+
* converts the value's `_animation` slot into a throwing setter — the next
|
|
9
|
+
* `Animated.timing(v).start()` then crashes with
|
|
10
|
+
* "_animation: object that is meant to be immutable".
|
|
11
|
+
*
|
|
12
|
+
* Sealing the value at construction makes `Object.isSealed(v) === true`,
|
|
13
|
+
* which causes `deepFreezeAndThrowOnMutationInDev` to skip-and-return at
|
|
14
|
+
* its top guard. Existing-property mutation (`_animation`, `_value`,
|
|
15
|
+
* `_listeners`, `_tracking`) keeps working — seal only blocks adding NEW
|
|
16
|
+
* properties, and `Animated.Value` doesn't add any post-construction.
|
|
17
|
+
*
|
|
18
|
+
* Use everywhere the library would otherwise call `new Animated.Value(...)`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createAnimatedValue: (initial: number, config?: ConstructorParameters<typeof Animated.Value>[1]) => Animated.Value;
|
|
21
|
+
//# sourceMappingURL=animatedValue.d.ts.map
|
|
@@ -11,6 +11,7 @@ export { lightTheme, darkTheme } from './tokens';
|
|
|
11
11
|
export { mergeTheme } from './merge';
|
|
12
12
|
export { fontFor } from './textStyle';
|
|
13
13
|
export type { FontWeightKey } from './textStyle';
|
|
14
|
+
export { createAnimatedValue } from './animatedValue';
|
|
14
15
|
export { Gradient, isGradientAvailable } from './Gradient';
|
|
15
16
|
export type { GradientProps } from './Gradient';
|
|
16
17
|
export type { ColorMode, ColorPalette, GradientDefinition, GradientScale, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
|
|
@@ -295,9 +295,15 @@ export interface RadioTokens extends Partial<Record<ComponentSizeKey, RadioSizeT
|
|
|
295
295
|
borderWidth?: number;
|
|
296
296
|
labelGap?: number;
|
|
297
297
|
}
|
|
298
|
+
export interface InputComponentTokens extends Partial<Record<ComponentSizeKey, InputSizeTokens>> {
|
|
299
|
+
/** Default `variant` when caller doesn't pass one. Library default: 'outlined'. */
|
|
300
|
+
defaultVariant?: 'outlined' | 'filled';
|
|
301
|
+
/** Default `labelMode` when caller doesn't pass one. Library default: 'float'. */
|
|
302
|
+
defaultLabelMode?: 'float' | 'top';
|
|
303
|
+
}
|
|
298
304
|
export interface ComponentTokens {
|
|
299
305
|
button?: Partial<Record<ComponentSizeKey, ButtonSizeTokens>>;
|
|
300
|
-
input?:
|
|
306
|
+
input?: InputComponentTokens;
|
|
301
307
|
searchBar?: Partial<Record<ComponentSizeKey, SearchBarSizeTokens>> & {
|
|
302
308
|
cancelButtonWidth?: number;
|
|
303
309
|
};
|
|
@@ -3,6 +3,7 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
import type { BlurEvent, FocusEvent, StyleProp, TextInputProps, TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
export type InputSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
export type InputVariant = 'outlined' | 'filled';
|
|
6
|
+
export type InputLabelMode = 'float' | 'top';
|
|
6
7
|
export interface InputProps extends Omit<TextInputProps, 'style'> {
|
|
7
8
|
label?: string;
|
|
8
9
|
placeholder?: string;
|
|
@@ -18,6 +19,15 @@ export interface InputProps extends Omit<TextInputProps, 'style'> {
|
|
|
18
19
|
rightIcon?: React.ReactNode;
|
|
19
20
|
size?: InputSize;
|
|
20
21
|
variant?: InputVariant;
|
|
22
|
+
/**
|
|
23
|
+
* - `'float'` (default): Material-Design floating label that animates from
|
|
24
|
+
* inside the field to the top border on focus / when there's a value.
|
|
25
|
+
* - `'top'`: classic static label rendered above the field with no animation.
|
|
26
|
+
* Use for forms that want the label permanently visible.
|
|
27
|
+
*
|
|
28
|
+
* Theme override: `theme.components.input.defaultLabelMode`.
|
|
29
|
+
*/
|
|
30
|
+
labelMode?: InputLabelMode;
|
|
21
31
|
required?: boolean;
|
|
22
32
|
maxLength?: number;
|
|
23
33
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Create an `Animated.Value` that survives RN 0.85's dev-mode prop deepFreeze.
|
|
4
|
+
*
|
|
5
|
+
* RN's Fabric renderer deep-freezes prop trees on host components. If an
|
|
6
|
+
* `Animated.Value` is reachable from a `style` prop via interpolation chains
|
|
7
|
+
* (the `_parent` ref on `AnimatedInterpolation` nodes), the recursive freeze
|
|
8
|
+
* converts the value's `_animation` slot into a throwing setter — the next
|
|
9
|
+
* `Animated.timing(v).start()` then crashes with
|
|
10
|
+
* "_animation: object that is meant to be immutable".
|
|
11
|
+
*
|
|
12
|
+
* Sealing the value at construction makes `Object.isSealed(v) === true`,
|
|
13
|
+
* which causes `deepFreezeAndThrowOnMutationInDev` to skip-and-return at
|
|
14
|
+
* its top guard. Existing-property mutation (`_animation`, `_value`,
|
|
15
|
+
* `_listeners`, `_tracking`) keeps working — seal only blocks adding NEW
|
|
16
|
+
* properties, and `Animated.Value` doesn't add any post-construction.
|
|
17
|
+
*
|
|
18
|
+
* Use everywhere the library would otherwise call `new Animated.Value(...)`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createAnimatedValue: (initial: number, config?: ConstructorParameters<typeof Animated.Value>[1]) => Animated.Value;
|
|
21
|
+
//# sourceMappingURL=animatedValue.d.ts.map
|
|
@@ -11,6 +11,7 @@ export { lightTheme, darkTheme } from './tokens';
|
|
|
11
11
|
export { mergeTheme } from './merge';
|
|
12
12
|
export { fontFor } from './textStyle';
|
|
13
13
|
export type { FontWeightKey } from './textStyle';
|
|
14
|
+
export { createAnimatedValue } from './animatedValue';
|
|
14
15
|
export { Gradient, isGradientAvailable } from './Gradient';
|
|
15
16
|
export type { GradientProps } from './Gradient';
|
|
16
17
|
export type { ColorMode, ColorPalette, GradientDefinition, GradientScale, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
|
|
@@ -295,9 +295,15 @@ export interface RadioTokens extends Partial<Record<ComponentSizeKey, RadioSizeT
|
|
|
295
295
|
borderWidth?: number;
|
|
296
296
|
labelGap?: number;
|
|
297
297
|
}
|
|
298
|
+
export interface InputComponentTokens extends Partial<Record<ComponentSizeKey, InputSizeTokens>> {
|
|
299
|
+
/** Default `variant` when caller doesn't pass one. Library default: 'outlined'. */
|
|
300
|
+
defaultVariant?: 'outlined' | 'filled';
|
|
301
|
+
/** Default `labelMode` when caller doesn't pass one. Library default: 'float'. */
|
|
302
|
+
defaultLabelMode?: 'float' | 'top';
|
|
303
|
+
}
|
|
298
304
|
export interface ComponentTokens {
|
|
299
305
|
button?: Partial<Record<ComponentSizeKey, ButtonSizeTokens>>;
|
|
300
|
-
input?:
|
|
306
|
+
input?: InputComponentTokens;
|
|
301
307
|
searchBar?: Partial<Record<ComponentSizeKey, SearchBarSizeTokens>> & {
|
|
302
308
|
cancelButtonWidth?: number;
|
|
303
309
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority-technologies/mobile",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components plus API/auth/logging/network/storage utilities for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|