@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.
Files changed (69) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +3 -3
  2. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  3. package/lib/commonjs/components/Badge/Badge.js +1 -1
  4. package/lib/commonjs/components/Banner/Banner.js +2 -2
  5. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
  6. package/lib/commonjs/components/Carousel/Carousel.js +2 -2
  7. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  8. package/lib/commonjs/components/DatePicker/DatePicker.js +8 -8
  9. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +4 -4
  10. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +2 -2
  11. package/lib/commonjs/components/FormField/FormField.js +1 -1
  12. package/lib/commonjs/components/Input/Input.js +15 -7
  13. package/lib/commonjs/components/Modal/Modal.js +4 -4
  14. package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
  15. package/lib/commonjs/components/ProgressBar/ProgressBar.js +2 -2
  16. package/lib/commonjs/components/Radio/Radio.js +1 -1
  17. package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
  18. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +2 -2
  19. package/lib/commonjs/components/Select/Select.js +3 -3
  20. package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
  21. package/lib/commonjs/components/Slider/Slider.js +6 -6
  22. package/lib/commonjs/components/Spinner/Spinner.js +2 -2
  23. package/lib/commonjs/components/Stepper/Stepper.js +3 -3
  24. package/lib/commonjs/components/Switch/Switch.js +3 -3
  25. package/lib/commonjs/components/Tabs/Tabs.js +2 -2
  26. package/lib/commonjs/components/TimePicker/TimePicker.js +3 -3
  27. package/lib/commonjs/components/Toast/Toast.js +3 -3
  28. package/lib/commonjs/components/Tooltip/Tooltip.js +2 -2
  29. package/lib/commonjs/theme/animatedValue.js +28 -0
  30. package/lib/commonjs/theme/index.js +7 -0
  31. package/lib/module/components/Accordion/Accordion.js +4 -4
  32. package/lib/module/components/Avatar/Avatar.js +2 -2
  33. package/lib/module/components/Badge/Badge.js +2 -2
  34. package/lib/module/components/Banner/Banner.js +3 -3
  35. package/lib/module/components/BottomNavigation/BottomNavigation.js +2 -2
  36. package/lib/module/components/Carousel/Carousel.js +3 -3
  37. package/lib/module/components/Checkbox/Checkbox.js +2 -2
  38. package/lib/module/components/DatePicker/DatePicker.js +9 -9
  39. package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -5
  40. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +3 -3
  41. package/lib/module/components/FormField/FormField.js +2 -2
  42. package/lib/module/components/Input/Input.js +16 -8
  43. package/lib/module/components/Modal/Modal.js +5 -5
  44. package/lib/module/components/OTPInput/OTPInput.js +2 -2
  45. package/lib/module/components/ProgressBar/ProgressBar.js +3 -3
  46. package/lib/module/components/Radio/Radio.js +2 -2
  47. package/lib/module/components/SearchBar/SearchBar.js +2 -2
  48. package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -3
  49. package/lib/module/components/Select/Select.js +4 -4
  50. package/lib/module/components/Skeleton/Skeleton.js +2 -2
  51. package/lib/module/components/Slider/Slider.js +7 -7
  52. package/lib/module/components/Spinner/Spinner.js +3 -3
  53. package/lib/module/components/Stepper/Stepper.js +4 -4
  54. package/lib/module/components/Switch/Switch.js +4 -4
  55. package/lib/module/components/Tabs/Tabs.js +3 -3
  56. package/lib/module/components/TimePicker/TimePicker.js +4 -4
  57. package/lib/module/components/Toast/Toast.js +4 -4
  58. package/lib/module/components/Tooltip/Tooltip.js +3 -3
  59. package/lib/module/theme/animatedValue.js +24 -0
  60. package/lib/module/theme/index.js +1 -0
  61. package/lib/typescript/commonjs/components/Input/Input.d.ts +10 -0
  62. package/lib/typescript/commonjs/theme/animatedValue.d.ts +21 -0
  63. package/lib/typescript/commonjs/theme/index.d.ts +1 -0
  64. package/lib/typescript/commonjs/theme/types.d.ts +7 -1
  65. package/lib/typescript/module/components/Input/Input.d.ts +10 -0
  66. package/lib/typescript/module/theme/animatedValue.d.ts +21 -0
  67. package/lib/typescript/module/theme/index.d.ts +1 -0
  68. package/lib/typescript/module/theme/types.d.ts +7 -1
  69. 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?: Partial<Record<ComponentSizeKey, InputSizeTokens>>;
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?: Partial<Record<ComponentSizeKey, InputSizeTokens>>;
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.8",
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",