@factorialco/f0-react-native 0.34.0 → 0.36.0

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 (59) hide show
  1. package/README.md +7 -5
  2. package/lib/module/components/Button/index.js +1 -1
  3. package/lib/module/components/Button/index.js.map +1 -1
  4. package/lib/module/components/F0Button/F0Button.js +2 -0
  5. package/lib/module/components/F0Button/F0Button.js.map +1 -0
  6. package/lib/module/components/F0Button/F0Button.md +163 -0
  7. package/lib/module/components/F0Button/F0Button.styles.js +2 -0
  8. package/lib/module/components/F0Button/F0Button.styles.js.map +1 -0
  9. package/lib/module/components/F0Button/F0Button.types.js +2 -0
  10. package/lib/module/components/F0Button/F0Button.types.js.map +1 -0
  11. package/lib/module/components/F0Button/index.js +2 -0
  12. package/lib/module/components/F0Button/index.js.map +1 -0
  13. package/lib/module/components/Icon/index.js.map +1 -1
  14. package/lib/module/components/exports.js +1 -1
  15. package/lib/module/components/exports.js.map +1 -1
  16. package/lib/module/components/primitives/F0Image/F0Image.js +2 -0
  17. package/lib/module/components/primitives/F0Image/F0Image.js.map +1 -0
  18. package/lib/module/components/primitives/F0Image/F0Image.md +40 -0
  19. package/lib/module/components/primitives/F0Image/F0Image.types.js +2 -0
  20. package/lib/module/components/primitives/F0Image/F0Image.types.js.map +1 -0
  21. package/lib/module/components/primitives/F0Image/index.js +2 -0
  22. package/lib/module/components/primitives/F0Image/index.js.map +1 -0
  23. package/lib/typescript/components/Button/index.d.ts +18 -0
  24. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  25. package/lib/typescript/components/F0Button/F0Button.d.ts +6 -0
  26. package/lib/typescript/components/F0Button/F0Button.d.ts.map +1 -0
  27. package/lib/typescript/components/F0Button/F0Button.styles.d.ts +161 -0
  28. package/lib/typescript/components/F0Button/F0Button.styles.d.ts.map +1 -0
  29. package/lib/typescript/components/F0Button/F0Button.types.d.ts +47 -0
  30. package/lib/typescript/components/F0Button/F0Button.types.d.ts.map +1 -0
  31. package/lib/typescript/components/F0Button/index.d.ts +4 -0
  32. package/lib/typescript/components/F0Button/index.d.ts.map +1 -0
  33. package/lib/typescript/components/Icon/index.d.ts +5 -0
  34. package/lib/typescript/components/Icon/index.d.ts.map +1 -1
  35. package/lib/typescript/components/exports.d.ts +2 -0
  36. package/lib/typescript/components/exports.d.ts.map +1 -1
  37. package/lib/typescript/components/primitives/F0Image/F0Image.d.ts +11 -0
  38. package/lib/typescript/components/primitives/F0Image/F0Image.d.ts.map +1 -0
  39. package/lib/typescript/components/primitives/F0Image/F0Image.types.d.ts +21 -0
  40. package/lib/typescript/components/primitives/F0Image/F0Image.types.d.ts.map +1 -0
  41. package/lib/typescript/components/primitives/F0Image/index.d.ts +3 -0
  42. package/lib/typescript/components/primitives/F0Image/index.d.ts.map +1 -0
  43. package/package.json +2 -1
  44. package/src/components/Button/__snapshots__/index.spec.tsx.snap +11 -11
  45. package/src/components/Button/index.tsx +22 -2
  46. package/src/components/F0Button/F0Button.md +163 -0
  47. package/src/components/F0Button/F0Button.styles.ts +141 -0
  48. package/src/components/F0Button/F0Button.tsx +228 -0
  49. package/src/components/F0Button/F0Button.types.ts +82 -0
  50. package/src/components/F0Button/__tests__/F0Button.spec.tsx +285 -0
  51. package/src/components/F0Button/__tests__/__snapshots__/F0Button.spec.tsx.snap +966 -0
  52. package/src/components/F0Button/index.ts +7 -0
  53. package/src/components/Icon/index.tsx +5 -0
  54. package/src/components/exports.ts +2 -0
  55. package/src/components/primitives/F0Image/F0Image.md +40 -0
  56. package/src/components/primitives/F0Image/F0Image.tsx +48 -0
  57. package/src/components/primitives/F0Image/F0Image.types.ts +23 -0
  58. package/src/components/primitives/F0Image/__tests__/F0Image.spec.tsx +46 -0
  59. package/src/components/primitives/F0Image/index.ts +2 -0
@@ -0,0 +1,161 @@
1
+ import type { IconColor } from "../primitives/F0Icon";
2
+ import type { TextColor } from "../primitives/F0Text";
3
+ import type { ButtonVariant } from "./F0Button.types";
4
+ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
5
+ variant: {
6
+ default: string;
7
+ outline: string;
8
+ neutral: string;
9
+ critical: string;
10
+ ghost: string;
11
+ promote: string;
12
+ };
13
+ size: {
14
+ sm: string;
15
+ md: string;
16
+ lg: string;
17
+ };
18
+ disabled: {
19
+ true: string;
20
+ false: string;
21
+ };
22
+ round: {
23
+ true: string;
24
+ false: string;
25
+ };
26
+ }, undefined, "flex-row items-center justify-center rounded border-none grow-0", {
27
+ variant: {
28
+ default: string;
29
+ outline: string;
30
+ neutral: string;
31
+ critical: string;
32
+ ghost: string;
33
+ promote: string;
34
+ };
35
+ size: {
36
+ sm: string;
37
+ md: string;
38
+ lg: string;
39
+ };
40
+ disabled: {
41
+ true: string;
42
+ false: string;
43
+ };
44
+ round: {
45
+ true: string;
46
+ false: string;
47
+ };
48
+ }, undefined, import("tailwind-variants").TVReturnType<{
49
+ variant: {
50
+ default: string;
51
+ outline: string;
52
+ neutral: string;
53
+ critical: string;
54
+ ghost: string;
55
+ promote: string;
56
+ };
57
+ size: {
58
+ sm: string;
59
+ md: string;
60
+ lg: string;
61
+ };
62
+ disabled: {
63
+ true: string;
64
+ false: string;
65
+ };
66
+ round: {
67
+ true: string;
68
+ false: string;
69
+ };
70
+ }, undefined, "flex-row items-center justify-center rounded border-none grow-0", unknown, unknown, undefined>>;
71
+ export declare const pressedVariants: import("tailwind-variants").TVReturnType<{
72
+ variant: {
73
+ default: string;
74
+ outline: string;
75
+ neutral: string;
76
+ critical: string;
77
+ ghost: string;
78
+ promote: string;
79
+ };
80
+ }, undefined, "", {
81
+ variant: {
82
+ default: string;
83
+ outline: string;
84
+ neutral: string;
85
+ critical: string;
86
+ ghost: string;
87
+ promote: string;
88
+ };
89
+ }, undefined, import("tailwind-variants").TVReturnType<{
90
+ variant: {
91
+ default: string;
92
+ outline: string;
93
+ neutral: string;
94
+ critical: string;
95
+ ghost: string;
96
+ promote: string;
97
+ };
98
+ }, undefined, "", unknown, unknown, undefined>>;
99
+ export declare const loadingContentVariants: import("tailwind-variants").TVReturnType<{
100
+ loading: {
101
+ true: string;
102
+ false: string;
103
+ };
104
+ }, undefined, undefined, {
105
+ loading: {
106
+ true: string;
107
+ false: string;
108
+ };
109
+ }, undefined, import("tailwind-variants").TVReturnType<{
110
+ loading: {
111
+ true: string;
112
+ false: string;
113
+ };
114
+ }, undefined, undefined, unknown, unknown, undefined>>;
115
+ export declare const loadingIndicatorVariants: import("tailwind-variants").TVReturnType<{
116
+ variant: {
117
+ default: string;
118
+ outline: string;
119
+ neutral: string;
120
+ critical: string;
121
+ ghost: string;
122
+ promote: string;
123
+ };
124
+ size: {
125
+ sm: string;
126
+ md: string;
127
+ lg: string;
128
+ };
129
+ }, undefined, "rounded-full border-solid border-t-transparent", {
130
+ variant: {
131
+ default: string;
132
+ outline: string;
133
+ neutral: string;
134
+ critical: string;
135
+ ghost: string;
136
+ promote: string;
137
+ };
138
+ size: {
139
+ sm: string;
140
+ md: string;
141
+ lg: string;
142
+ };
143
+ }, undefined, import("tailwind-variants").TVReturnType<{
144
+ variant: {
145
+ default: string;
146
+ outline: string;
147
+ neutral: string;
148
+ critical: string;
149
+ ghost: string;
150
+ promote: string;
151
+ };
152
+ size: {
153
+ sm: string;
154
+ md: string;
155
+ lg: string;
156
+ };
157
+ }, undefined, "rounded-full border-solid border-t-transparent", unknown, unknown, undefined>>;
158
+ export declare const getIconColor: (variant: ButtonVariant, isPressed: boolean) => IconColor;
159
+ export declare const getIconOnlyColor: (variant: ButtonVariant, isPressed: boolean) => IconColor;
160
+ export declare const getTextColor: (variant: ButtonVariant, isPressed: boolean) => TextColor;
161
+ //# sourceMappingURL=F0Button.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/F0Button/F0Button.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8GA+BzB,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAe1B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;sDAUjC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6FAqBnC,CAAA;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,aAAa,EACtB,WAAW,OAAO,KACjB,SASF,CAAA;AAED,eAAO,MAAM,gBAAgB,GAC3B,SAAS,aAAa,EACtB,WAAW,OAAO,KACjB,SAaF,CAAA;AAED,eAAO,MAAM,YAAY,GACvB,SAAS,aAAa,EACtB,WAAW,OAAO,KACjB,SAaF,CAAA"}
@@ -0,0 +1,47 @@
1
+ import type { IconType } from "../primitives/F0Icon";
2
+ import type { PressableFeedbackProps, PressableFeedbackVariant } from "../primitives/PressableFeedback";
3
+ /**
4
+ * Button variant types
5
+ */
6
+ export declare const BUTTON_VARIANTS: readonly ["default", "outline", "critical", "neutral", "ghost", "promote"];
7
+ export type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
8
+ export type F0ButtonVariant = ButtonVariant;
9
+ /**
10
+ * Button size types
11
+ */
12
+ export declare const BUTTON_SIZES: readonly ["sm", "md", "lg"];
13
+ export type ButtonSize = (typeof BUTTON_SIZES)[number];
14
+ export type F0ButtonSize = ButtonSize;
15
+ /**
16
+ * Props that are controlled by F0Button and must not be passed through.
17
+ * This preserves F0Button press-state behavior and accessibility contract.
18
+ */
19
+ declare const F0_BUTTON_CONTROLLED_PASSTHROUGH_PROPS: readonly ["onPressIn", "onPressOut", "accessibilityLabel", "accessibilityRole", "accessibilityState"];
20
+ export declare const F0_BUTTON_BANNED_PROPS: readonly ["style", "className"];
21
+ export declare const F0_BUTTON_BLOCKED_FORWARD_PROPS: readonly ["onPressIn", "onPressOut", "accessibilityLabel", "accessibilityRole", "accessibilityState", "style", "className"];
22
+ interface F0ButtonPropsInternal extends Omit<PressableFeedbackProps, "children" | "variant" | "disabled" | (typeof F0_BUTTON_CONTROLLED_PASSTHROUGH_PROPS)[number]> {
23
+ label: string;
24
+ onPress?: () => void | Promise<unknown>;
25
+ variant?: ButtonVariant;
26
+ size?: ButtonSize;
27
+ disabled?: boolean;
28
+ loading?: boolean;
29
+ icon?: IconType;
30
+ emoji?: string;
31
+ hideLabel?: boolean;
32
+ round?: boolean;
33
+ showBadge?: boolean;
34
+ fullWidth?: boolean;
35
+ accessibilityHint?: string;
36
+ testID?: string;
37
+ feedback?: PressableFeedbackVariant;
38
+ }
39
+ /**
40
+ * Public props for the F0Button component.
41
+ *
42
+ * Note: `className` and `style` props are NOT available.
43
+ * Use semantic props (variant, size, etc.) for styling.
44
+ */
45
+ export type F0ButtonProps = Omit<F0ButtonPropsInternal, (typeof F0_BUTTON_BANNED_PROPS)[number]>;
46
+ export {};
47
+ //# sourceMappingURL=F0Button.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Button.types.d.ts","sourceRoot":"","sources":["../../../../src/components/F0Button/F0Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,iCAAiC,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,4EAOlB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,aAAa,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,YAAY,6BAA8B,CAAA;AAEvD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AACtD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAA;AAErC;;;GAGG;AACH,QAAA,MAAM,sCAAsC,uGAMlC,CAAA;AAEV,eAAO,MAAM,sBAAsB,iCAAkC,CAAA;AAErE,eAAO,MAAM,+BAA+B,6HAGlC,CAAA;AAEV,UAAU,qBAAsB,SAAQ,IAAI,CAC1C,sBAAsB,EACpB,UAAU,GACV,SAAS,GACT,UAAU,GACV,CAAC,OAAO,sCAAsC,CAAC,CAAC,MAAM,CAAC,CAC1D;IACC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACvC,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,wBAAwB,CAAA;CACpC;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,qBAAqB,EACrB,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CACxC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { F0Button } from "./F0Button";
2
+ export { BUTTON_VARIANTS, BUTTON_SIZES } from "./F0Button.types";
3
+ export type { F0ButtonProps, F0ButtonVariant, F0ButtonSize, } from "./F0Button.types";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/F0Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAChE,YAAY,EACV,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,kBAAkB,CAAA"}
@@ -27,6 +27,11 @@ declare const iconVariants: import("tailwind-variants").TVReturnType<{
27
27
  xs: string;
28
28
  };
29
29
  }, undefined, "shrink-0", unknown, unknown, undefined>>;
30
+ /**
31
+ * @deprecated Use `F0IconProps` from `../primitives/F0Icon` instead.
32
+ * Migration: Replace `IconProps` with `F0IconProps`.
33
+ * `F0Icon` supports `icon`, `size`, `testID`, and `className`, and adds semantic `color` variants.
34
+ */
30
35
  export interface IconProps extends SvgProps, VariantProps<typeof iconVariants> {
31
36
  icon: IconType;
32
37
  testID?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzD,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEtE,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;uDAchB,CAAA;AAEF,MAAM,WAAW,SAAU,SAAQ,QAAQ,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC;IAC5E,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,uEAiBf,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzD,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEtE,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;uDAchB,CAAA;AAEF;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,QAAQ,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC;IAC5E,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,uEAiBf,CAAA"}
@@ -2,6 +2,7 @@ export * from "./Activity/ActivityItem";
2
2
  export * from "./Avatars/exports";
3
3
  export * from "./Badge";
4
4
  export * from "./Button";
5
+ export * from "./F0Button";
5
6
  export * from "./F0Badge";
6
7
  export * from "./Counter";
7
8
  export * from "./ExampleComponent";
@@ -15,5 +16,6 @@ export * from "./experimental/Lists/DetailsItem";
15
16
  export * from "./experimental/Lists/DetailsItemsList";
16
17
  export * from "./primitives/F0Text";
17
18
  export * from "./primitives/F0Icon";
19
+ export * from "./primitives/F0Image";
18
20
  export * from "./primitives/PressableFeedback";
19
21
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/components/exports.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA;AAGrD,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/components/exports.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uCAAuC,CAAA;AAGrD,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gCAAgC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { Image as ExpoImage } from "expo-image";
2
+ import React from "react";
3
+ import type { F0ImageProps } from "./F0Image.types";
4
+ /**
5
+ * F0Image - Image primitive for React Native in F0.
6
+ *
7
+ * Wraps `expo-image` to provide className support and sane defaults.
8
+ */
9
+ declare const F0Image: React.MemoExoticComponent<React.ForwardRefExoticComponent<F0ImageProps & React.RefAttributes<ExpoImage>>>;
10
+ export { F0Image };
11
+ //# sourceMappingURL=F0Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Image.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Image/F0Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAInD;;;;GAIG;AACH,QAAA,MAAM,OAAO,2GA4BZ,CAAA;AAID,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { ImageProps as ExpoImageProps } from "expo-image";
2
+ /**
3
+ * Public F0Image props.
4
+ *
5
+ * Thin primitive wrapper around `expo-image` with className support.
6
+ */
7
+ export interface F0ImageProps extends Omit<ExpoImageProps, "source" | "style"> {
8
+ /**
9
+ * Image source passed to expo-image.
10
+ */
11
+ source: ExpoImageProps["source"];
12
+ /**
13
+ * Utility classes for sizing/layout.
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Inline style escape hatch.
18
+ */
19
+ style?: ExpoImageProps["style"];
20
+ }
21
+ //# sourceMappingURL=F0Image.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Image.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Image/F0Image.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5E;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAEhC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAChC"}
@@ -0,0 +1,3 @@
1
+ export { F0Image } from "./F0Image";
2
+ export type { F0ImageProps } from "./F0Image.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react-native",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "type": "module",
5
5
  "description": "React Native components for F0 Design System",
6
6
  "main": "expo-router/entry",
@@ -75,6 +75,7 @@
75
75
  "license": "MIT",
76
76
  "peerDependencies": {
77
77
  "date-fns": "^3.6.0",
78
+ "expo-image": "~3.0.11",
78
79
  "react": "*",
79
80
  "react-native": "*",
80
81
  "react-native-reanimated": "^3.19.4",
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Button Snapshot - critical variant 1`] = `
4
4
  <View
5
- className="flex item-start"
5
+ className="flex items-start"
6
6
  >
7
7
  <View
8
8
  accessibilityLabel="Test Button"
@@ -49,7 +49,7 @@ exports[`Button Snapshot - critical variant 1`] = `
49
49
 
50
50
  exports[`Button Snapshot - default button 1`] = `
51
51
  <View
52
- className="flex item-start"
52
+ className="flex items-start"
53
53
  >
54
54
  <View
55
55
  accessibilityLabel="Test Button"
@@ -96,7 +96,7 @@ exports[`Button Snapshot - default button 1`] = `
96
96
 
97
97
  exports[`Button Snapshot - different sizes 1`] = `
98
98
  <View
99
- className="flex item-start"
99
+ className="flex items-start"
100
100
  >
101
101
  <View
102
102
  accessibilityLabel="Test Button"
@@ -143,7 +143,7 @@ exports[`Button Snapshot - different sizes 1`] = `
143
143
 
144
144
  exports[`Button Snapshot - different sizes 2`] = `
145
145
  <View
146
- className="flex item-start"
146
+ className="flex items-start"
147
147
  >
148
148
  <View
149
149
  accessibilityLabel="Test Button"
@@ -190,7 +190,7 @@ exports[`Button Snapshot - different sizes 2`] = `
190
190
 
191
191
  exports[`Button Snapshot - different sizes 3`] = `
192
192
  <View
193
- className="flex item-start"
193
+ className="flex items-start"
194
194
  >
195
195
  <View
196
196
  accessibilityLabel="Test Button"
@@ -237,7 +237,7 @@ exports[`Button Snapshot - different sizes 3`] = `
237
237
 
238
238
  exports[`Button Snapshot - disabled state 1`] = `
239
239
  <View
240
- className="flex item-start"
240
+ className="flex items-start"
241
241
  >
242
242
  <View
243
243
  accessibilityLabel="Test Button, disabled"
@@ -284,7 +284,7 @@ exports[`Button Snapshot - disabled state 1`] = `
284
284
 
285
285
  exports[`Button Snapshot - loading state 1`] = `
286
286
  <View
287
- className="flex item-start"
287
+ className="flex items-start"
288
288
  >
289
289
  <View
290
290
  accessibilityLabel="Test Button, disabled, loading"
@@ -331,7 +331,7 @@ exports[`Button Snapshot - loading state 1`] = `
331
331
 
332
332
  exports[`Button Snapshot - outline variant 1`] = `
333
333
  <View
334
- className="flex item-start"
334
+ className="flex items-start"
335
335
  >
336
336
  <View
337
337
  accessibilityLabel="Test Button"
@@ -378,7 +378,7 @@ exports[`Button Snapshot - outline variant 1`] = `
378
378
 
379
379
  exports[`Button Snapshot - round button with hidden label 1`] = `
380
380
  <View
381
- className="flex item-start"
381
+ className="flex items-start"
382
382
  >
383
383
  <View
384
384
  accessibilityLabel="Test Button"
@@ -419,7 +419,7 @@ exports[`Button Snapshot - round button with hidden label 1`] = `
419
419
 
420
420
  exports[`Button Snapshot - with emoji 1`] = `
421
421
  <View
422
- className="flex item-start"
422
+ className="flex items-start"
423
423
  >
424
424
  <View
425
425
  accessibilityLabel="Test Button"
@@ -471,7 +471,7 @@ exports[`Button Snapshot - with emoji 1`] = `
471
471
 
472
472
  exports[`Button Snapshot - with icon 1`] = `
473
473
  <View
474
- className="flex item-start"
474
+ className="flex items-start"
475
475
  >
476
476
  <View
477
477
  accessibilityLabel="Test Button"
@@ -3,8 +3,11 @@ import { Pressable, Text, View } from "react-native"
3
3
  import { tv, type VariantProps } from "tailwind-variants"
4
4
 
5
5
  import { cn } from "../../lib/utils"
6
- import { F0Icon, type IconType, type IconColor } from "../primitives/F0Icon"
6
+ import { F0Icon, type IconColor, type IconType } from "../primitives/F0Icon"
7
7
 
8
+ /**
9
+ * @deprecated Use `F0Button` from `../F0Button` instead.
10
+ */
8
11
  export const variants = [
9
12
  "default",
10
13
  "outline",
@@ -13,9 +16,20 @@ export const variants = [
13
16
  "ghost",
14
17
  "promote",
15
18
  ] as const
19
+
20
+ /**
21
+ * @deprecated Use `F0ButtonVariant` from `../F0Button` instead.
22
+ */
16
23
  export type ButtonVariant = (typeof variants)[number]
17
24
 
25
+ /**
26
+ * @deprecated Use `BUTTON_SIZES` from `../F0Button` instead.
27
+ */
18
28
  export const sizes = ["sm", "md", "lg"] as const
29
+
30
+ /**
31
+ * @deprecated Use `F0ButtonSize` from `../F0Button` instead.
32
+ */
19
33
  export type ButtonSize = (typeof sizes)[number]
20
34
 
21
35
  const buttonVariants = tv({
@@ -115,6 +129,9 @@ const getTextColorClass = (variant: ButtonVariant, isPressed: boolean) => {
115
129
  }
116
130
  }
117
131
 
132
+ /**
133
+ * @deprecated Use `F0ButtonProps` from `../F0Button` instead.
134
+ */
118
135
  export interface ButtonProps extends VariantProps<typeof buttonVariants> {
119
136
  label: string
120
137
  onPress?: () => void | Promise<unknown>
@@ -129,6 +146,9 @@ export interface ButtonProps extends VariantProps<typeof buttonVariants> {
129
146
  fullWidth?: boolean
130
147
  }
131
148
 
149
+ /**
150
+ * @deprecated Use `F0Button` from `../F0Button` instead.
151
+ */
132
152
  export const Button = forwardRef<View, ButtonProps>(function Button(
133
153
  {
134
154
  label,
@@ -171,7 +191,7 @@ export const Button = forwardRef<View, ButtonProps>(function Button(
171
191
  const shouldShowPressed = isPressed && !isDisabled
172
192
 
173
193
  return (
174
- <View className={`flex ${fullWidth ? "flex-1" : "item-start"}`}>
194
+ <View className={`flex ${fullWidth ? "flex-1" : "items-start"}`}>
175
195
  <Pressable
176
196
  ref={ref}
177
197
  disabled={isDisabled}
@@ -0,0 +1,163 @@
1
+ # F0Button
2
+
3
+ Primary interactive button component for the F0 Design System.
4
+
5
+ ## Overview
6
+
7
+ F0Button is the semantic button API for React Native in F0. It supports:
8
+
9
+ - Visual variants (`default`, `outline`, `critical`, `neutral`, `ghost`, `promote`)
10
+ - Size variants (`sm`, `md`, `lg`)
11
+ - Optional icon / emoji content
12
+ - Icon-only round mode
13
+ - Async press handlers with automatic loading-state handling
14
+ - Visible loading indicator when busy
15
+ - Press feedback control through `PressableFeedback`
16
+
17
+ ## Architecture
18
+
19
+ - **Pattern:** Props API (Atomic) - element order is fixed: icon -> emoji -> label
20
+ - **Press feedback:** Uses `PressableFeedback` component for smooth animations
21
+ - **Press state:** Tracks pressed state with `useState` for color changes by variant
22
+ - **Loading state:** Supports auto-loading when `onPress` returns a Promise
23
+ - **Styling:** `className` and `style` are blocked in the public API and filtered at runtime
24
+ - **Location:** `src/components/F0Button/`
25
+
26
+ ## Usage
27
+
28
+ <!-- prettier-ignore -->
29
+ ```tsx
30
+ import { F0Button } from "@factorialco/f0-react-native"
31
+ import { Archive } from "@factorialco/f0-react-native/icons/app"
32
+
33
+ <F0Button label="Submit" onPress={handleSubmit} />
34
+
35
+ <F0Button label="Delete" variant="critical" icon={Archive} />
36
+
37
+ <F0Button label="Add" icon={Archive} hideLabel round />
38
+
39
+ <F0Button label="Save" onPress={async () => await saveData()} />
40
+
41
+ <F0Button label="Love" emoji="🥰" variant="neutral" />
42
+
43
+ <F0Button label="Custom" feedback="scale" />
44
+ ```
45
+
46
+ ## Props
47
+
48
+ | Prop | Type | Default | Description |
49
+ | ------------------- | -------------------------------- | ----------- | ---------------------------------------------------------- |
50
+ | `label` | `string` | required | Visible label and accessibility base label |
51
+ | `onPress` | `() => void \| Promise<unknown>` | — | Press handler; async return enables auto-loading |
52
+ | `variant` | `F0ButtonVariant` | `"default"` | Visual style variant |
53
+ | `size` | `F0ButtonSize` | `"md"` | Control height and radius |
54
+ | `disabled` | `boolean` | `false` | Disabled state |
55
+ | `loading` | `boolean` | `false` | External loading control |
56
+ | `icon` | `IconType` | — | Optional icon |
57
+ | `emoji` | `string` | — | Optional emoji |
58
+ | `hideLabel` | `boolean` | `false` | Hide visible label (keeps accessibility label) |
59
+ | `round` | `boolean` | `false` | Makes icon-only mode circular |
60
+ | `showBadge` | `boolean` | `false` | Notification badge (outline variant only) |
61
+ | `fullWidth` | `boolean` | `false` | Makes button fill available horizontal space |
62
+ | `feedback` | `PressableFeedbackVariant` | `"both"` | Press feedback mode (`both`, `scale`, `highlight`, `none`) |
63
+ | `accessibilityHint` | `string` | — | Optional screen-reader hint |
64
+ | `testID` | `string` | — | Test identifier |
65
+
66
+ ### Variants
67
+
68
+ - `default` - primary/high-emphasis action
69
+ - `outline` - secondary action with border
70
+ - `critical` - destructive action
71
+ - `neutral` - neutral secondary action
72
+ - `ghost` - subtle transparent action
73
+ - `promote` - promotional/highlighted action
74
+
75
+ ### Sizes
76
+
77
+ - `sm` - compact
78
+ - `md` - default
79
+ - `lg` - large
80
+
81
+ ## Runtime Behavior
82
+
83
+ ### Async onPress auto-loading
84
+
85
+ If `onPress` returns a Promise, F0Button enters internal loading state until it resolves.
86
+
87
+ <!-- prettier-ignore -->
88
+ ```tsx
89
+ <F0Button
90
+ label="Save"
91
+ onPress={async () => {
92
+ await saveData()
93
+ }}
94
+ />
95
+ ```
96
+
97
+ ### Loading visuals
98
+
99
+ When `loading` is `true` (external) or an async `onPress` is pending (internal):
100
+
101
+ - the button becomes non-interactive (`disabled`)
102
+ - a centered spinner indicator is rendered
103
+ - button content is visually hidden (`opacity`) to keep layout stable
104
+
105
+ ### Press feedback
106
+
107
+ F0Button delegates touch feedback to `PressableFeedback` and supports semantic control via `feedback`.
108
+
109
+ <!-- prettier-ignore -->
110
+ ```tsx
111
+ <F0Button label="Both" feedback="both" />
112
+ <F0Button label="Scale only" feedback="scale" />
113
+ <F0Button label="Highlight only" feedback="highlight" />
114
+ <F0Button label="No visual feedback" feedback="none" />
115
+ ```
116
+
117
+ ## Styling Contract
118
+
119
+ F0Button is semantic-first:
120
+
121
+ - `className` is **not** part of `F0ButtonProps`
122
+ - `style` is **not** part of `F0ButtonProps`
123
+ - Both are filtered at runtime before forwarding props to internal pressable primitives
124
+
125
+ This guarantees semantic variants remain source-of-truth and prevents style overrides from bypassing the API contract.
126
+
127
+ ## Accessibility
128
+
129
+ - Always sets `accessibilityRole="button"`
130
+ - Auto-builds `accessibilityLabel` from `label` plus state:
131
+ - `"label, disabled"`
132
+ - `"label, disabled, loading"`
133
+ - Exposes `accessibilityState` with:
134
+ - `disabled`
135
+ - `busy`
136
+ - `hideLabel` does not remove accessibility label
137
+
138
+ ## Testing
139
+
140
+ Main test suite:
141
+
142
+ - `src/components/F0Button/__tests__/F0Button.spec.tsx`
143
+
144
+ Coverage includes:
145
+
146
+ - snapshots across variants/sizes/states
147
+ - async loading behavior
148
+ - accessibility label/state
149
+ - badge rendering rules
150
+ - runtime blocking of `className`/`style`
151
+
152
+ ## File Structure
153
+
154
+ ```
155
+ src/components/F0Button/
156
+ ├── F0Button.tsx
157
+ ├── F0Button.types.ts
158
+ ├── F0Button.styles.ts
159
+ ├── F0Button.md
160
+ ├── __tests__/
161
+ │ └── F0Button.spec.tsx
162
+ └── index.ts
163
+ ```