fluent-styles 1.62.12 → 1.62.14

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 (42) hide show
  1. package/lib/commonjs/input/index.js +56 -37
  2. package/lib/commonjs/input/index.js.map +1 -1
  3. package/lib/commonjs/utiles/viewStyleVariants.js +139 -80
  4. package/lib/commonjs/utiles/viewStyleVariants.js.map +1 -1
  5. package/lib/module/input/index.js +56 -37
  6. package/lib/module/input/index.js.map +1 -1
  7. package/lib/module/utiles/viewStyleVariants.js +139 -80
  8. package/lib/module/utiles/viewStyleVariants.js.map +1 -1
  9. package/lib/typescript/divider/index.d.ts +0 -1
  10. package/lib/typescript/divider/index.d.ts.map +1 -1
  11. package/lib/typescript/input/index.d.ts +1 -7
  12. package/lib/typescript/input/index.d.ts.map +1 -1
  13. package/lib/typescript/portal/PortalContext.d.ts +0 -1
  14. package/lib/typescript/portal/PortalContext.d.ts.map +1 -1
  15. package/lib/typescript/pressable/index.d.ts +0 -1
  16. package/lib/typescript/pressable/index.d.ts.map +1 -1
  17. package/lib/typescript/safeAreaProvider/index.d.ts +0 -1
  18. package/lib/typescript/safeAreaProvider/index.d.ts.map +1 -1
  19. package/lib/typescript/safeAreaView/index.d.ts +0 -1
  20. package/lib/typescript/safeAreaView/index.d.ts.map +1 -1
  21. package/lib/typescript/scrollView/index.d.ts +0 -1
  22. package/lib/typescript/scrollView/index.d.ts.map +1 -1
  23. package/lib/typescript/shape/index.d.ts +0 -1
  24. package/lib/typescript/shape/index.d.ts.map +1 -1
  25. package/lib/typescript/spacer/index.d.ts +0 -1
  26. package/lib/typescript/spacer/index.d.ts.map +1 -1
  27. package/lib/typescript/stack/index.d.ts +0 -1
  28. package/lib/typescript/stack/index.d.ts.map +1 -1
  29. package/lib/typescript/text/index.d.ts +0 -1
  30. package/lib/typescript/text/index.d.ts.map +1 -1
  31. package/lib/typescript/utiles/viewStyleVariants.d.ts +61 -55
  32. package/lib/typescript/utiles/viewStyleVariants.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/input/index.tsx +56 -39
  35. package/src/utiles/viewStyleVariants.ts +225 -186
  36. package/lib/commonjs/portal/portal.test.js +0 -154
  37. package/lib/commonjs/portal/portal.test.js.map +0 -1
  38. package/lib/module/portal/portal.test.js +0 -155
  39. package/lib/module/portal/portal.test.js.map +0 -1
  40. package/lib/typescript/portal/portal.test.d.ts +0 -11
  41. package/lib/typescript/portal/portal.test.d.ts.map +0 -1
  42. package/src/portal/portal.test.ts +0 -157
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pressable/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,KAAK,oBAAoB,GAAG,cAAc,GAAG,SAAS,CAAC;AAEvD,QAAA,MAAM,eAAe;;;;;CAOnB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pressable/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,KAAK,oBAAoB,GAAG,cAAc,GAAG,SAAS,CAAC;AAEvD,QAAA,MAAM,eAAe;;;;;CAOnB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SafeAreaProviderProps } from 'react-native-safe-area-context';
3
2
  type StyledSafeAreaProviderProps = SafeAreaProviderProps;
4
3
  declare const StyledSafeAreaProvider: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/safeAreaProvider/index.ts"],"names":[],"mappings":";AACA,OAAO,EAEH,qBAAqB,EACxB,MAAM,gCAAgC,CAAC;AAGxC,KAAK,2BAA2B,GAAG,qBAAqB,CAAC;AAEzD,QAAA,MAAM,sBAAsB;;;;;CAG1B,CAAC;AAEH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/safeAreaProvider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,qBAAqB,EACxB,MAAM,gCAAgC,CAAC;AAGxC,KAAK,2BAA2B,GAAG,qBAAqB,CAAC;AAEzD,QAAA,MAAM,sBAAsB;;;;;CAG1B,CAAC;AAEH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SafeAreaViewProps } from 'react-native-safe-area-context';
3
2
  import { ViewStyleProps } from '../utiles/viewStyleProps';
4
3
  type StyledSafeAreaViewProps = SafeAreaViewProps & ViewStyleProps;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/safeAreaView/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEH,iBAAiB,EACpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAGrE,KAAK,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAElE,QAAA,MAAM,kBAAkB;;;;;CAOtB,CAAC;AAEH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/safeAreaView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,iBAAiB,EACpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAGrE,KAAK,uBAAuB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAElE,QAAA,MAAM,kBAAkB;;;;;CAOtB,CAAC;AAEH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ScrollViewProps } from 'react-native';
3
2
  import { ViewStyleProps } from '../utiles/viewStyleProps';
4
3
  type StyledScrollViewProps = ScrollViewProps & ViewStyleProps;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scrollView/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,KAAK,qBAAqB,GAAG,eAAe,GAAG,cAAc,CAAC;AAE9D,QAAA,MAAM,gBAAgB;;;;;CAIpB,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/scrollView/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,KAAK,qBAAqB,GAAG,eAAe,GAAG,cAAc,CAAC;AAE9D,QAAA,MAAM,gBAAgB;;;;;CAIpB,CAAC;AAEH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ViewProps, ViewStyle } from 'react-native';
3
2
  type ShapeVariants = {
4
3
  cycle?: boolean | [boolean, ViewStyle];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shape/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1D,KAAK,aAAa,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,CAAC;CACzD,CAAC;AAEF,KAAK,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,QAAA,MAAM,WAAW;;;;;CAyBf,CAAC;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shape/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1D,KAAK,aAAa,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,CAAC;CACzD,CAAC;AAEF,KAAK,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,QAAA,MAAM,WAAW;;;;;CAyBf,CAAC;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ViewProps } from 'react-native';
3
2
  import { ViewStyleProps } from '../utiles/viewStyleProps';
4
3
  type SpacerProps = ViewProps & (Pick<ViewStyleProps, 'margin' | 'marginTop' | 'marginBottom' | 'marginLeft' | 'marginRight' | 'marginHorizontal' | 'marginVertical' | 'backgroundColor' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'flex' | 'width' | 'height'>);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spacer/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,KAAK,WAAW,GAAI,SAAS,GAAG,CAAC,IAAI,CAAC,cAAc,EAChD,QAAQ,GACR,WAAW,GACX,cAAc,GACd,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,OAAO,GACP,QAAQ,CAAC,CAAC,CAAC;AAEf,QAAA,MAAM,YAAY;;;;;CAIhB,CAAC;AAEH,OAAO,EAAG,YAAY,EAAE,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spacer/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAErE,KAAK,WAAW,GAAI,SAAS,GAAG,CAAC,IAAI,CAAC,cAAc,EAChD,QAAQ,GACR,WAAW,GACX,cAAc,GACd,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,OAAO,GACP,QAAQ,CAAC,CAAC,CAAC;AAEf,QAAA,MAAM,YAAY;;;;;CAIhB,CAAC;AAEH,OAAO,EAAG,YAAY,EAAE,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ViewProps, ViewStyle } from 'react-native';
3
2
  /**
4
3
  * Stack-specific layout variants for flex direction
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stack/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1D;;;;;GAKG;AACH,KAAK,aAAa,GAAG;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD;;;;GAIG;AACH,QAAA,MAAM,KAAK;;;;;CAoBT,CAAC;AAEH,QAAA,MAAM,MAAM;;;;;CASV,CAAC;AAEH,QAAA,MAAM,MAAM;;;;;CASV,CAAC;AAEH,OAAO,EAAG,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stack/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1D;;;;;GAKG;AACH,KAAK,aAAa,GAAG;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CAC7C,CAAC;AAEF,KAAK,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD;;;;GAIG;AACH,QAAA,MAAM,KAAK;;;;;CAoBT,CAAC;AAEH,QAAA,MAAM,MAAM;;;;;CASV,CAAC;AAEH,QAAA,MAAM,MAAM;;;;;CASV,CAAC;AAEH,OAAO,EAAG,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TextProps, TextStyle } from 'react-native';
3
2
  type TextVariants = {
4
3
  fontSize?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/index.ts"],"names":[],"mappings":";AACA,OAAO,EAEH,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AAItB,KAAK,YAAY,GAAG;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAE;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,eAAe,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D,QAAA,MAAM,UAAU;;;;;CAgDd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,SAAS,EACT,SAAS,EACZ,MAAM,cAAc,CAAC;AAItB,KAAK,YAAY,GAAG;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAE;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,eAAe,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D,QAAA,MAAM,UAAU;;;;;CAgDd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,53 +1,58 @@
1
1
  import { ViewStyle } from 'react-native';
2
+ /**
3
+ * A raw variant value as it arrives from a prop. Numeric props (e.g. `width={100}`)
4
+ * come through as `number`, string props (e.g. `width="100%"`) come through as `string`.
5
+ */
6
+ type RawValue = string | number | null | undefined;
2
7
  export declare const viewStyleVariants: {
3
- width: (selected: string) => ViewStyle;
4
- height: (selected: string) => ViewStyle;
5
- minWidth: (selected: string) => ViewStyle;
6
- maxWidth: (selected: string) => ViewStyle;
7
- minHeight: (selected: string) => ViewStyle;
8
- maxHeight: (selected: string) => ViewStyle;
9
- top: (selected: string) => ViewStyle;
10
- bottom: (selected: string) => ViewStyle;
11
- left: (selected: string) => ViewStyle;
12
- right: (selected: string) => ViewStyle;
13
- margin: (selected: string) => ViewStyle;
14
- marginTop: (selected: string) => ViewStyle;
15
- marginBottom: (selected: string) => ViewStyle;
16
- marginLeft: (selected: string) => ViewStyle;
17
- marginRight: (selected: string) => ViewStyle;
18
- marginHorizontal: (selected: string) => ViewStyle;
19
- marginVertical: (selected: string) => ViewStyle;
20
- padding: (selected: string) => ViewStyle;
21
- paddingTop: (selected: string) => ViewStyle;
22
- paddingBottom: (selected: string) => ViewStyle;
23
- paddingLeft: (selected: string) => ViewStyle;
24
- paddingRight: (selected: string) => ViewStyle;
25
- paddingHorizontal: (selected: string) => ViewStyle;
26
- paddingVertical: (selected: string) => ViewStyle;
27
- borderWidth: (selected: string) => ViewStyle;
28
- borderTopWidth: (selected: string) => ViewStyle;
29
- borderBottomWidth: (selected: string) => ViewStyle;
30
- borderLeftWidth: (selected: string) => ViewStyle;
31
- borderRightWidth: (selected: string) => ViewStyle;
32
- borderRadius: (selected: string) => ViewStyle;
33
- borderTopLeftRadius: (selected: string) => ViewStyle;
34
- borderTopRightRadius: (selected: string) => ViewStyle;
35
- borderBottomLeftRadius: (selected: string) => ViewStyle;
36
- borderBottomRightRadius: (selected: string) => ViewStyle;
37
- borderColor: (selected: string) => ViewStyle;
38
- borderTopColor: (selected: string) => ViewStyle;
39
- borderBottomColor: (selected: string) => ViewStyle;
40
- borderLeftColor: (selected: string) => ViewStyle;
41
- borderRightColor: (selected: string) => ViewStyle;
42
- backgroundColor: (selected: string) => ViewStyle;
43
- opacity: (selected: string) => ViewStyle;
44
- rotation: (selected: string) => ViewStyle;
45
- scale: (selected: string) => ViewStyle;
46
- shadowOpacity: (selected: string) => ViewStyle;
47
- shadowRadius: (selected: string) => ViewStyle;
48
- shadowColor: (selected: string) => ViewStyle;
49
- elevation: (selected: string) => ViewStyle;
50
- zIndex: (selected: string) => ViewStyle;
8
+ width: (selected: RawValue) => ViewStyle;
9
+ height: (selected: RawValue) => ViewStyle;
10
+ minWidth: (selected: RawValue) => ViewStyle;
11
+ maxWidth: (selected: RawValue) => ViewStyle;
12
+ minHeight: (selected: RawValue) => ViewStyle;
13
+ maxHeight: (selected: RawValue) => ViewStyle;
14
+ top: (selected: RawValue) => ViewStyle;
15
+ bottom: (selected: RawValue) => ViewStyle;
16
+ left: (selected: RawValue) => ViewStyle;
17
+ right: (selected: RawValue) => ViewStyle;
18
+ margin: (selected: RawValue) => ViewStyle;
19
+ marginTop: (selected: RawValue) => ViewStyle;
20
+ marginBottom: (selected: RawValue) => ViewStyle;
21
+ marginLeft: (selected: RawValue) => ViewStyle;
22
+ marginRight: (selected: RawValue) => ViewStyle;
23
+ marginHorizontal: (selected: RawValue) => ViewStyle;
24
+ marginVertical: (selected: RawValue) => ViewStyle;
25
+ padding: (selected: RawValue) => ViewStyle;
26
+ paddingTop: (selected: RawValue) => ViewStyle;
27
+ paddingBottom: (selected: RawValue) => ViewStyle;
28
+ paddingLeft: (selected: RawValue) => ViewStyle;
29
+ paddingRight: (selected: RawValue) => ViewStyle;
30
+ paddingHorizontal: (selected: RawValue) => ViewStyle;
31
+ paddingVertical: (selected: RawValue) => ViewStyle;
32
+ borderWidth: (selected: RawValue) => ViewStyle;
33
+ borderTopWidth: (selected: RawValue) => ViewStyle;
34
+ borderBottomWidth: (selected: RawValue) => ViewStyle;
35
+ borderLeftWidth: (selected: RawValue) => ViewStyle;
36
+ borderRightWidth: (selected: RawValue) => ViewStyle;
37
+ borderRadius: (selected: RawValue) => ViewStyle;
38
+ borderTopLeftRadius: (selected: RawValue) => ViewStyle;
39
+ borderTopRightRadius: (selected: RawValue) => ViewStyle;
40
+ borderBottomLeftRadius: (selected: RawValue) => ViewStyle;
41
+ borderBottomRightRadius: (selected: RawValue) => ViewStyle;
42
+ borderColor: (selected: RawValue) => ViewStyle;
43
+ borderTopColor: (selected: RawValue) => ViewStyle;
44
+ borderBottomColor: (selected: RawValue) => ViewStyle;
45
+ borderLeftColor: (selected: RawValue) => ViewStyle;
46
+ borderRightColor: (selected: RawValue) => ViewStyle;
47
+ backgroundColor: (selected: RawValue) => ViewStyle;
48
+ opacity: (selected: RawValue) => ViewStyle;
49
+ rotation: (selected: RawValue) => ViewStyle;
50
+ scale: (selected: RawValue) => ViewStyle;
51
+ shadowOpacity: (selected: RawValue) => ViewStyle;
52
+ shadowRadius: (selected: RawValue) => ViewStyle;
53
+ shadowColor: (selected: RawValue) => ViewStyle;
54
+ elevation: (selected: RawValue) => ViewStyle;
55
+ zIndex: (selected: RawValue) => ViewStyle;
51
56
  };
52
57
  export declare const viewStyleStringVariants: {
53
58
  position: {
@@ -110,12 +115,13 @@ export declare const viewStyleStringVariants: {
110
115
  dotted: ViewStyle;
111
116
  dashed: ViewStyle;
112
117
  };
113
- flex: (selected: string) => ViewStyle;
114
- flexBasis: (selected: string) => ViewStyle;
115
- flexGrow: (selected: string) => ViewStyle;
116
- flexShrink: (selected: string) => ViewStyle;
117
- gap: (selected: string) => ViewStyle;
118
- columnGap: (selected: string) => ViewStyle;
119
- rowGap: (selected: string) => ViewStyle;
118
+ flex: (selected: RawValue) => ViewStyle;
119
+ flexBasis: (selected: RawValue) => ViewStyle;
120
+ flexGrow: (selected: RawValue) => ViewStyle;
121
+ flexShrink: (selected: RawValue) => ViewStyle;
122
+ gap: (selected: RawValue) => ViewStyle;
123
+ columnGap: (selected: RawValue) => ViewStyle;
124
+ rowGap: (selected: RawValue) => ViewStyle;
120
125
  };
126
+ export {};
121
127
  //# sourceMappingURL=viewStyleVariants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"viewStyleVariants.d.ts","sourceRoot":"","sources":["../../../src/utiles/viewStyleVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,iBAAiB;sBAEV,MAAM;uBAML,MAAM;yBAMJ,MAAM;yBAMN,MAAM;0BAML,MAAM;0BAMN,MAAM;oBAOZ,MAAM;uBAMH,MAAM;qBAMR,MAAM;sBAML,MAAM;uBAOL,MAAM;0BAMH,MAAM;6BAMH,MAAM;2BAMR,MAAM;4BAML,MAAM;iCAMD,MAAM;+BAMR,MAAM;wBAOb,MAAM;2BAMH,MAAM;8BAMH,MAAM;4BAMR,MAAM;6BAML,MAAM;kCAMD,MAAM;gCAMR,MAAM;4BAOV,MAAM;+BAMH,MAAM;kCAMH,MAAM;gCAMR,MAAM;iCAML,MAAM;6BAOV,MAAM;oCAMC,MAAM;qCAML,MAAM;uCAMJ,MAAM;wCAML,MAAM;4BAOlB,MAAM;+BAKH,MAAM;kCAKH,MAAM;gCAKR,MAAM;iCAKL,MAAM;gCAMP,MAAM;wBAKd,MAAM;yBAOL,MAAM;sBAMT,MAAM;8BAOE,MAAM;6BAMP,MAAM;4BAMP,MAAM;0BAMR,MAAM;uBAOT,MAAM;CAK1B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAuEjB,MAAM;0BAMD,MAAM;yBAMP,MAAM;2BAMJ,MAAM;oBAOb,MAAM;0BAMA,MAAM;uBAMT,MAAM;CAK1B,CAAC"}
1
+ {"version":3,"file":"viewStyleVariants.d.ts","sourceRoot":"","sources":["../../../src/utiles/viewStyleVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAmCnD,eAAO,MAAM,iBAAiB;sBAEV,QAAQ;uBAMP,QAAQ;yBAMN,QAAQ;yBAMR,QAAQ;0BAMP,QAAQ;0BAMR,QAAQ;oBAOd,QAAQ;uBAML,QAAQ;qBAMV,QAAQ;sBAMP,QAAQ;uBAOP,QAAQ;0BAML,QAAQ;6BAML,QAAQ;2BAMV,QAAQ;4BAMP,QAAQ;iCAMH,QAAQ;+BAMV,QAAQ;wBAOf,QAAQ;2BAML,QAAQ;8BAML,QAAQ;4BAMV,QAAQ;6BAMP,QAAQ;kCAMH,QAAQ;gCAMV,QAAQ;4BAOZ,QAAQ;+BAML,QAAQ;kCAML,QAAQ;gCAMV,QAAQ;iCAMP,QAAQ;6BAOZ,QAAQ;oCAMD,QAAQ;qCAMP,QAAQ;uCAMN,QAAQ;wCAMP,QAAQ;4BAOpB,QAAQ;+BAKL,QAAQ;kCAKL,QAAQ;gCAKV,QAAQ;iCAKP,QAAQ;gCAMT,QAAQ;wBAKhB,QAAQ;yBAOP,QAAQ;sBAMX,QAAQ;8BAOA,QAAQ;6BAMT,QAAQ;4BAMT,QAAQ;0BAMV,QAAQ;uBAOX,QAAQ;CAK5B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAuEjB,QAAQ;0BAMH,QAAQ;yBAMT,QAAQ;2BAMN,QAAQ;oBAOf,QAAQ;0BAMF,QAAQ;uBAMX,QAAQ;CAK5B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluent-styles",
3
3
  "description": "Develop different styled versions of UI components.",
4
- "version": "1.62.12",
4
+ "version": "1.62.14",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
7
7
  "react-native": "src/index.ts",
@@ -15,13 +15,10 @@ import {
15
15
  View,
16
16
  } from 'react-native'
17
17
  import type {
18
- NativeSyntheticEvent,
19
- TextInputFocusEventData,
20
18
  TextStyle,
21
19
  ViewStyle,
22
20
  } from 'react-native'
23
21
 
24
- import { styled } from '../utiles/styled'
25
22
  import { theme } from '../utiles/theme'
26
23
  import { viewStyleVariants, viewStyleStringVariants } from '../utiles/viewStyleVariants'
27
24
  import { StyledText } from '../text'
@@ -132,38 +129,52 @@ export interface StyledTextInputProps
132
129
 
133
130
  }
134
131
 
135
- const TextInputBase = styled<CardComponentProps>(TextInput, {
136
- base: {
137
- borderColor: theme.colors.gray[200],
138
- backgroundColor: theme.colors.gray[1],
139
- flex : 1,
140
- color: theme.colors.gray[800],
141
- paddingHorizontal: 16,
142
- paddingVertical: 12,
143
- fontSize: theme.fontSize.normal,
144
- minHeight: 48,
145
- },
146
- variants: {
147
- ...viewStyleVariants,
148
- ...viewStyleStringVariants,
149
-
150
- fontSize: (selected: string) => {
151
- const size = selected || theme.fontSize.normal;
152
- if (isNaN(Number(size))) {
153
- // throw new Error('Invalid fontSize value');
154
- }
155
- return { fontSize: Number(size) };
156
- },
132
+ // ─── Flat style-prop resolution ────────────────────────────────────────────────
133
+ // Replaces the generic `styled()` wrapper that used to sit around TextInput.
134
+ // Preserves its behaviour exactly: any flat ViewStyle/TextStyle prop (e.g.
135
+ // `opacity`, `padding`, `borderColor`) passed straight to StyledTextInput is
136
+ // resolved into a real style on the inner TextInput and stripped out of the
137
+ // props spread onto it — same variant maps `styled()` used, resolved locally
138
+ // instead of through the shared HOC.
139
+ const BASE_INPUT_STYLE: TextStyle = {
140
+ borderColor: theme.colors.gray[200],
141
+ backgroundColor: theme.colors.gray[1],
142
+ flex: 1,
143
+ color: theme.colors.gray[800],
144
+ paddingHorizontal: 16,
145
+ paddingVertical: 12,
146
+ fontSize: theme.fontSize.normal,
147
+ minHeight: 48,
148
+ }
157
149
 
158
- fontWeight: (selected: string) => {
159
- const weight = selected || theme.fontWeight.normal;
160
- if (isNaN(Number(weight))) {
161
- // throw new Error('Invalid fontWeight value');
162
- }
163
- return { fontWeight: weight as any };
164
- },
165
- }
166
- });
150
+ const FLAT_STYLE_VARIANTS: Record<string, any> = {
151
+ ...viewStyleVariants,
152
+ ...viewStyleStringVariants,
153
+ }
154
+
155
+ const resolveFlatStyle = (
156
+ props: Record<string, any>,
157
+ ): { style: TextStyle; clean: Record<string, any> } => {
158
+ const style: TextStyle = { ...BASE_INPUT_STYLE }
159
+ const clean: Record<string, any> = { ...props }
160
+
161
+ Object.keys(FLAT_STYLE_VARIANTS).forEach((key) => {
162
+ if (!(key in clean)) return
163
+ const selected = clean[key]
164
+ delete clean[key]
165
+
166
+ const variant = FLAT_STYLE_VARIANTS[key]
167
+ if (typeof variant === 'function') {
168
+ const resolved = variant(selected, props)
169
+ if (resolved) Object.assign(style, resolved)
170
+ } else if (variant?.[selected]) {
171
+ const value = variant[selected]
172
+ Object.assign(style, typeof value === 'function' ? value(selected, props) : value)
173
+ }
174
+ })
175
+
176
+ return { style, clean }
177
+ }
167
178
 
168
179
  export interface StyledTextInputHandle extends StyledTextInputProps {
169
180
  focus: () => void
@@ -396,7 +407,7 @@ export const StyledTextInput = (
396
407
  onBlur: onBlurProp,
397
408
  ref,
398
409
  ...rest
399
- }: StyledTextInputProps & { ref?: React.Ref<React.ComponentRef<typeof TextInputBase>> },
410
+ }: StyledTextInputProps & { ref?: React.Ref<StyledTextInputHandle> },
400
411
  ) => {
401
412
  const [focused, setFocused] = useState(false)
402
413
  const [localValue, setLocalValue] = useState(defaultValue ?? '')
@@ -418,12 +429,12 @@ export const StyledTextInput = (
418
429
  onChangeText?.(text)
419
430
  }, [value, onChangeText])
420
431
 
421
- const handleFocus = useCallback((e: NativeSyntheticEvent<TextInputFocusEventData>) => {
432
+ const handleFocus = useCallback((e: Parameters<NonNullable<TextInputProps['onFocus']>>[0]) => {
422
433
  setFocused(true)
423
434
  onFocusProp?.(e)
424
435
  }, [onFocusProp])
425
436
 
426
- const handleBlur = useCallback((e: NativeSyntheticEvent<TextInputFocusEventData>) => {
437
+ const handleBlur = useCallback((e: Parameters<NonNullable<TextInputProps['onBlur']>>[0]) => {
427
438
  setFocused(false)
428
439
  onBlurProp?.(e)
429
440
  }, [onBlurProp])
@@ -451,6 +462,11 @@ export const StyledTextInput = (
451
462
  const hasLeftAddon = !!leftAddon
452
463
  const hasRightAddon = !!rightAddon
453
464
 
465
+ // Resolves any flat ViewStyle/TextStyle prop passed straight to
466
+ // StyledTextInput (e.g. `opacity`, `padding`) into a real style, and
467
+ // strips those keys out of what gets spread onto the native TextInput.
468
+ const { style: flatStyle, clean: cleanRest } = resolveFlatStyle(rest)
469
+
454
470
  // ── Right-side icons (priority: loading > clear > rightIcon) ─────────
455
471
  const resolvedRightNode = loading ? (
456
472
  <ActivityIndicator size="small" color={theme.colors.gray[400]} />
@@ -535,7 +551,7 @@ export const StyledTextInput = (
535
551
  ) : null}
536
552
 
537
553
  {/* Core TextInput */}
538
- <TextInputBase
554
+ <TextInput
539
555
  ref={inputRef}
540
556
  value={value}
541
557
  defaultValue={defaultValue}
@@ -549,6 +565,7 @@ export const StyledTextInput = (
549
565
  numberOfLines={numberOfLines}
550
566
  maxLength={maxLength}
551
567
  style={[
568
+ flatStyle,
552
569
  S.input,
553
570
  {
554
571
  fontSize: fontSizeProp ?? sz.fontSize,
@@ -562,7 +579,7 @@ export const StyledTextInput = (
562
579
  },
563
580
  inputStyle,
564
581
  ]}
565
- {...rest}
582
+ {...cleanRest}
566
583
  />
567
584
 
568
585
  {/* Right icon / clear / spinner */}