@factorialco/f0-react-native 0.29.0 → 0.31.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 (130) hide show
  1. package/lib/module/components/Avatars/IconAvatar/index.js +1 -1
  2. package/lib/module/components/Avatars/IconAvatar/index.js.map +1 -1
  3. package/lib/module/components/Avatars/ModuleAvatar/index.js +1 -1
  4. package/lib/module/components/Avatars/ModuleAvatar/index.js.map +1 -1
  5. package/lib/module/components/Badge/index.js +1 -1
  6. package/lib/module/components/Badge/index.js.map +1 -1
  7. package/lib/module/components/Button/index.js +1 -1
  8. package/lib/module/components/Button/index.js.map +1 -1
  9. package/lib/module/components/Button/index.spec.js +1 -1
  10. package/lib/module/components/Button/index.spec.js.map +1 -1
  11. package/lib/module/components/Icon/index.js +1 -1
  12. package/lib/module/components/Icon/index.js.map +1 -1
  13. package/lib/module/components/OneChip/index.js +1 -1
  14. package/lib/module/components/OneChip/index.js.map +1 -1
  15. package/lib/module/components/OnePreset/index.js +1 -1
  16. package/lib/module/components/OnePreset/index.js.map +1 -1
  17. package/lib/module/components/Tags/AlertTab/index.js +1 -1
  18. package/lib/module/components/Tags/AlertTab/index.js.map +1 -1
  19. package/lib/module/components/Tags/BaseTag/index.js +1 -1
  20. package/lib/module/components/Tags/BaseTag/index.js.map +1 -1
  21. package/lib/module/components/Tags/RawTag/index.js +1 -1
  22. package/lib/module/components/Tags/RawTag/index.js.map +1 -1
  23. package/lib/module/components/experimental/Lists/DataList/ItemContainer.js +1 -1
  24. package/lib/module/components/experimental/Lists/DataList/ItemContainer.js.map +1 -1
  25. package/lib/module/components/experimental/Lists/DataList/actions/CopyAction.js +1 -1
  26. package/lib/module/components/experimental/Lists/DataList/actions/CopyAction.js.map +1 -1
  27. package/lib/module/components/experimental/Lists/DataList/actions/GenericAction.js +1 -1
  28. package/lib/module/components/experimental/Lists/DataList/actions/GenericAction.js.map +1 -1
  29. package/lib/module/components/exports.js +1 -1
  30. package/lib/module/components/exports.js.map +1 -1
  31. package/lib/module/components/primitives/F0Icon/F0Icon.js +2 -0
  32. package/lib/module/components/primitives/F0Icon/F0Icon.js.map +1 -0
  33. package/lib/module/components/primitives/F0Icon/F0Icon.md +187 -0
  34. package/lib/module/components/primitives/F0Icon/F0Icon.styles.js +2 -0
  35. package/lib/module/components/primitives/F0Icon/F0Icon.styles.js.map +1 -0
  36. package/lib/module/components/primitives/F0Icon/F0Icon.types.js +2 -0
  37. package/lib/module/components/primitives/F0Icon/F0Icon.types.js.map +1 -0
  38. package/lib/module/components/primitives/F0Icon/index.js +2 -0
  39. package/lib/module/components/primitives/F0Icon/index.js.map +1 -0
  40. package/lib/module/components/primitives/PressableFeedback/PressableFeedback.js +2 -0
  41. package/lib/module/components/primitives/PressableFeedback/PressableFeedback.js.map +1 -0
  42. package/lib/module/components/primitives/PressableFeedback/PressableFeedback.md +50 -0
  43. package/lib/module/components/primitives/PressableFeedback/PressableFeedback.types.js +2 -0
  44. package/lib/module/components/primitives/PressableFeedback/PressableFeedback.types.js.map +1 -0
  45. package/lib/module/components/primitives/PressableFeedback/index.js +2 -0
  46. package/lib/module/components/primitives/PressableFeedback/index.js.map +1 -0
  47. package/lib/module/icons/index.js +1 -1
  48. package/lib/module/icons/index.js.map +1 -1
  49. package/lib/typescript/components/Activity/ActivityItem/index.d.ts +1 -1
  50. package/lib/typescript/components/Activity/ActivityItem/index.d.ts.map +1 -1
  51. package/lib/typescript/components/Avatars/IconAvatar/index.d.ts +1 -1
  52. package/lib/typescript/components/Avatars/IconAvatar/index.d.ts.map +1 -1
  53. package/lib/typescript/components/Avatars/ModuleAvatar/index.d.ts +1 -1
  54. package/lib/typescript/components/Avatars/ModuleAvatar/index.d.ts.map +1 -1
  55. package/lib/typescript/components/Badge/index.d.ts +1 -1
  56. package/lib/typescript/components/Badge/index.d.ts.map +1 -1
  57. package/lib/typescript/components/Button/index.d.ts +1 -1
  58. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  59. package/lib/typescript/components/Icon/index.d.ts +7 -14
  60. package/lib/typescript/components/Icon/index.d.ts.map +1 -1
  61. package/lib/typescript/components/OneChip/index.d.ts +1 -1
  62. package/lib/typescript/components/OneChip/index.d.ts.map +1 -1
  63. package/lib/typescript/components/Tags/RawTag/index.d.ts +1 -1
  64. package/lib/typescript/components/Tags/RawTag/index.d.ts.map +1 -1
  65. package/lib/typescript/components/experimental/Lists/DataList/ItemContainer.d.ts +1 -1
  66. package/lib/typescript/components/experimental/Lists/DataList/ItemContainer.d.ts.map +1 -1
  67. package/lib/typescript/components/experimental/Lists/DataList/actions/CopyAction.d.ts.map +1 -1
  68. package/lib/typescript/components/experimental/Lists/DataList/index.d.ts +1 -1
  69. package/lib/typescript/components/experimental/Lists/DataList/index.d.ts.map +1 -1
  70. package/lib/typescript/components/exports.d.ts +3 -2
  71. package/lib/typescript/components/exports.d.ts.map +1 -1
  72. package/lib/typescript/components/primitives/F0Icon/F0Icon.d.ts +25 -0
  73. package/lib/typescript/components/primitives/F0Icon/F0Icon.d.ts.map +1 -0
  74. package/lib/typescript/components/primitives/F0Icon/F0Icon.styles.d.ts +90 -0
  75. package/lib/typescript/components/primitives/F0Icon/F0Icon.styles.d.ts.map +1 -0
  76. package/lib/typescript/components/primitives/F0Icon/F0Icon.types.d.ts +47 -0
  77. package/lib/typescript/components/primitives/F0Icon/F0Icon.types.d.ts.map +1 -0
  78. package/lib/typescript/components/primitives/F0Icon/index.d.ts +10 -0
  79. package/lib/typescript/components/primitives/F0Icon/index.d.ts.map +1 -0
  80. package/lib/typescript/components/primitives/PressableFeedback/PressableFeedback.d.ts +18 -0
  81. package/lib/typescript/components/primitives/PressableFeedback/PressableFeedback.d.ts.map +1 -0
  82. package/lib/typescript/components/{PressableFeedback/index.d.ts → primitives/PressableFeedback/PressableFeedback.types.d.ts} +10 -7
  83. package/lib/typescript/components/primitives/PressableFeedback/PressableFeedback.types.d.ts.map +1 -0
  84. package/lib/typescript/components/primitives/PressableFeedback/index.d.ts +3 -0
  85. package/lib/typescript/components/primitives/PressableFeedback/index.d.ts.map +1 -0
  86. package/lib/typescript/icons/index.d.ts +0 -1
  87. package/lib/typescript/icons/index.d.ts.map +1 -1
  88. package/package.json +1 -1
  89. package/src/components/Activity/ActivityItem/index.spec.tsx +1 -1
  90. package/src/components/Activity/ActivityItem/index.tsx +1 -1
  91. package/src/components/Avatars/IconAvatar/index.tsx +6 -2
  92. package/src/components/Avatars/ModuleAvatar/index.tsx +1 -1
  93. package/src/components/Badge/index.tsx +2 -2
  94. package/src/components/Button/index.spec.tsx +3 -4
  95. package/src/components/Button/index.tsx +19 -13
  96. package/src/components/Icon/__tests__/Icon.spec.tsx +0 -4
  97. package/src/components/Icon/index.tsx +7 -26
  98. package/src/components/OneChip/index.tsx +4 -4
  99. package/src/components/OnePreset/index.tsx +1 -1
  100. package/src/components/Tags/AlertTab/index.tsx +2 -2
  101. package/src/components/Tags/BaseTag/index.tsx +1 -1
  102. package/src/components/Tags/RawTag/index.tsx +2 -2
  103. package/src/components/experimental/Lists/DataList/ItemContainer.tsx +2 -2
  104. package/src/components/experimental/Lists/DataList/actions/CopyAction.tsx +7 -10
  105. package/src/components/experimental/Lists/DataList/actions/GenericAction.tsx +2 -2
  106. package/src/components/experimental/Lists/DataList/index.tsx +1 -1
  107. package/src/components/experimental/Lists/DetailsItem/__snapshots__/index.spec.tsx.snap +4 -4
  108. package/src/components/experimental/Lists/DetailsItemsList/__snapshots__/index.spec.tsx.snap +1 -1
  109. package/src/components/exports.ts +3 -2
  110. package/src/components/primitives/F0Icon/F0Icon.md +187 -0
  111. package/src/components/primitives/F0Icon/F0Icon.styles.ts +43 -0
  112. package/src/components/primitives/F0Icon/F0Icon.tsx +73 -0
  113. package/src/components/primitives/F0Icon/F0Icon.types.ts +77 -0
  114. package/src/components/primitives/F0Icon/__tests__/F0Icon.spec.tsx +131 -0
  115. package/src/components/primitives/F0Icon/__tests__/F0Icon.tokens.spec.ts +39 -0
  116. package/src/components/primitives/F0Icon/index.ts +10 -0
  117. package/src/components/primitives/PressableFeedback/PressableFeedback.md +50 -0
  118. package/src/components/{PressableFeedback/index.tsx → primitives/PressableFeedback/PressableFeedback.tsx} +18 -44
  119. package/src/components/primitives/PressableFeedback/PressableFeedback.types.ts +45 -0
  120. package/src/components/{PressableFeedback → primitives/PressableFeedback/__tests__}/index.spec.tsx +1 -5
  121. package/src/components/primitives/PressableFeedback/index.ts +7 -0
  122. package/src/icons/index.ts +0 -1
  123. package/lib/module/components/Icon/README.md +0 -63
  124. package/lib/module/components/PressableFeedback/index.js +0 -2
  125. package/lib/module/components/PressableFeedback/index.js.map +0 -1
  126. package/lib/module/components/PressableFeedback/index.spec.js +0 -2
  127. package/lib/module/components/PressableFeedback/index.spec.js.map +0 -1
  128. package/lib/typescript/components/PressableFeedback/index.d.ts.map +0 -1
  129. package/src/components/Icon/README.md +0 -63
  130. /package/src/components/{PressableFeedback → primitives/PressableFeedback/__tests__}/__snapshots__/index.spec.tsx.snap +0 -0
@@ -0,0 +1,90 @@
1
+ /**
2
+ * F0Icon tailwind-variants configuration
3
+ * Size and color variants from the F0 design system
4
+ */
5
+ export declare const iconVariants: import("tailwind-variants").TVReturnType<{
6
+ size: {
7
+ xl: string;
8
+ lg: string;
9
+ md: string;
10
+ sm: string;
11
+ xs: string;
12
+ };
13
+ color: {
14
+ default: string;
15
+ secondary: string;
16
+ inverse: string;
17
+ bold: string;
18
+ critical: string;
19
+ "critical-bold": string;
20
+ accent: string;
21
+ info: string;
22
+ warning: string;
23
+ positive: string;
24
+ promote: string;
25
+ selected: string;
26
+ "selected-hover": string;
27
+ "mood-super-negative": string;
28
+ "mood-negative": string;
29
+ "mood-neutral": string;
30
+ "mood-positive": string;
31
+ "mood-super-positive": string;
32
+ };
33
+ }, undefined, "shrink-0", {
34
+ size: {
35
+ xl: string;
36
+ lg: string;
37
+ md: string;
38
+ sm: string;
39
+ xs: string;
40
+ };
41
+ color: {
42
+ default: string;
43
+ secondary: string;
44
+ inverse: string;
45
+ bold: string;
46
+ critical: string;
47
+ "critical-bold": string;
48
+ accent: string;
49
+ info: string;
50
+ warning: string;
51
+ positive: string;
52
+ promote: string;
53
+ selected: string;
54
+ "selected-hover": string;
55
+ "mood-super-negative": string;
56
+ "mood-negative": string;
57
+ "mood-neutral": string;
58
+ "mood-positive": string;
59
+ "mood-super-positive": string;
60
+ };
61
+ }, undefined, import("tailwind-variants").TVReturnType<{
62
+ size: {
63
+ xl: string;
64
+ lg: string;
65
+ md: string;
66
+ sm: string;
67
+ xs: string;
68
+ };
69
+ color: {
70
+ default: string;
71
+ secondary: string;
72
+ inverse: string;
73
+ bold: string;
74
+ critical: string;
75
+ "critical-bold": string;
76
+ accent: string;
77
+ info: string;
78
+ warning: string;
79
+ positive: string;
80
+ promote: string;
81
+ selected: string;
82
+ "selected-hover": string;
83
+ "mood-super-negative": string;
84
+ "mood-negative": string;
85
+ "mood-neutral": string;
86
+ "mood-positive": string;
87
+ "mood-super-positive": string;
88
+ };
89
+ }, undefined, "shrink-0", unknown, unknown, undefined>>;
90
+ //# sourceMappingURL=F0Icon.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Icon.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Icon/F0Icon.styles.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAoCvB,CAAA"}
@@ -0,0 +1,47 @@
1
+ import type { ForwardRefExoticComponent, RefAttributes } from "react";
2
+ import type { SvgProps } from "react-native-svg";
3
+ import type { Svg } from "react-native-svg";
4
+ import type { VariantProps } from "tailwind-variants";
5
+ import type { iconVariants } from "./F0Icon.styles";
6
+ /**
7
+ * Icon component type - forward ref to SVG component with className support
8
+ */
9
+ export type IconType = ForwardRefExoticComponent<SvgProps & RefAttributes<Svg> & {
10
+ className?: string;
11
+ }>;
12
+ /**
13
+ * Icon color variants derived from f0-icon-* tokens in src/styles/theme.css
14
+ * Sync is enforced by F0Icon.tokens.spec.ts
15
+ */
16
+ export declare const ICON_COLORS: readonly ["default", "secondary", "inverse", "bold", "critical", "critical-bold", "accent", "info", "warning", "positive", "promote", "selected", "selected-hover", "mood-super-negative", "mood-negative", "mood-neutral", "mood-positive", "mood-super-positive"];
17
+ export type IconColor = (typeof ICON_COLORS)[number];
18
+ /**
19
+ * Public F0Icon props
20
+ * Supports semantic color via `color` prop, with `className` as escape hatch.
21
+ */
22
+ export interface F0IconProps extends Omit<SvgProps, "style"> {
23
+ /**
24
+ * Tailwind className for custom styling or color overrides.
25
+ * Prefer the `color` prop for semantic icon colors.
26
+ */
27
+ className?: string;
28
+ /**
29
+ * Semantic icon color from the F0 design system
30
+ * Maps to f0-icon-* tokens (e.g. color="critical" -> text-f0-icon-critical)
31
+ */
32
+ color?: IconColor;
33
+ /**
34
+ * Icon component to render (from icons directory)
35
+ */
36
+ icon: IconType;
37
+ /**
38
+ * Icon size variant
39
+ * @default 'md'
40
+ */
41
+ size?: VariantProps<typeof iconVariants>["size"];
42
+ /**
43
+ * Test ID for testing
44
+ */
45
+ testID?: string;
46
+ }
47
+ //# sourceMappingURL=F0Icon.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F0Icon.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Icon/F0Icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,yBAAyB,CAC9C,QAAQ,GACN,aAAa,CAAC,GAAG,CAAC,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACJ,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,qQAmBd,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC1D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAA;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;IAEhD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * F0Icon - Icon primitive component
3
+ *
4
+ * @see F0Icon.md for documentation
5
+ */
6
+ export { default as F0Icon } from "./F0Icon";
7
+ export type { F0IconProps, IconType, IconColor } from "./F0Icon.types";
8
+ export { ICON_COLORS } from "./F0Icon.types";
9
+ export { applyIconInterop } from "./F0Icon";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/F0Icon/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA;AAC5C,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { View } from "react-native";
2
+ import type { PressableFeedbackProps } from "./PressableFeedback.types";
3
+ /**
4
+ * PressableFeedback - Internal pressable primitive with animated feedback
5
+ *
6
+ * Wraps React Native's Pressable with Reanimated scale and highlight
7
+ * animations. Used internally by F0 components.
8
+ *
9
+ * @internal
10
+ *
11
+ * @example
12
+ * <PressableFeedback variant="both" onPress={handlePress}>
13
+ * <View><F0Text>Press me</F0Text></View>
14
+ * </PressableFeedback>
15
+ */
16
+ export declare const PressableFeedback: import("react").ForwardRefExoticComponent<PressableFeedbackProps & import("react").RefAttributes<View>>;
17
+ export default PressableFeedback;
18
+ //# sourceMappingURL=PressableFeedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PressableFeedback.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/PressableFeedback/PressableFeedback.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAuB,MAAM,cAAc,CAAA;AAWnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AASvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,yGAuI7B,CAAA;AAID,eAAe,iBAAiB,CAAA"}
@@ -1,5 +1,5 @@
1
- import { View, type PressableProps } from "react-native";
2
- import { type WithTimingConfig } from "react-native-reanimated";
1
+ import type { PressableProps } from "react-native";
2
+ import type { WithTimingConfig } from "react-native-reanimated";
3
3
  export type PressableFeedbackVariant = "highlight" | "scale" | "both" | "none";
4
4
  export interface ScaleAnimationConfig {
5
5
  /** Scale value when pressed (0-1, default: 0.98) */
@@ -10,11 +10,16 @@ export interface ScaleAnimationConfig {
10
10
  export interface HighlightAnimationConfig {
11
11
  /** Background color of the highlight overlay */
12
12
  backgroundColor?: string;
13
- /** Opacity when pressed [min, max] (default: [0, 0.1]) */
13
+ /** Opacity when pressed [min, max] (default: [0, 0.15]) */
14
14
  opacity?: [number, number];
15
15
  /** Timing configuration for the animation */
16
16
  timingConfig?: WithTimingConfig;
17
17
  }
18
+ /**
19
+ * @internal
20
+ * PressableFeedback is an internal primitive used by other F0 components.
21
+ * It wraps React Native's Pressable with Reanimated scale/highlight animations.
22
+ */
18
23
  export interface PressableFeedbackProps extends Omit<PressableProps, "style" | "children"> {
19
24
  /** Visual feedback variant */
20
25
  variant?: PressableFeedbackVariant;
@@ -24,13 +29,11 @@ export interface PressableFeedbackProps extends Omit<PressableProps, "style" | "
24
29
  highlightAnimation?: HighlightAnimationConfig;
25
30
  /** Additional className for the pressable container */
26
31
  className?: string;
27
- /** Style for the pressable container */
32
+ /** Style for the pressable container (needed for Reanimated animated styles) */
28
33
  style?: PressableProps["style"];
29
34
  /** Children to render inside the pressable */
30
35
  children?: React.ReactNode;
31
36
  /** Whether animations are disabled */
32
37
  disableAnimation?: boolean;
33
38
  }
34
- export declare const PressableFeedback: import("react").ForwardRefExoticComponent<PressableFeedbackProps & import("react").RefAttributes<View>>;
35
- export default PressableFeedback;
36
- //# sourceMappingURL=index.d.ts.map
39
+ //# sourceMappingURL=PressableFeedback.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PressableFeedback.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/PressableFeedback/PressableFeedback.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9E,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6CAA6C;IAC7C,YAAY,CAAC,EAAE,gBAAgB,CAAA;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,gBAAgB,CAAA;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,cAAc,EACd,OAAO,GAAG,UAAU,CACrB;IACC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,wBAAwB,CAAA;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,wBAAwB,CAAA;IAC7C,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B"}
@@ -0,0 +1,3 @@
1
+ export { PressableFeedback, default } from "./PressableFeedback";
2
+ export type { PressableFeedbackProps, PressableFeedbackVariant, ScaleAnimationConfig, HighlightAnimationConfig, } from "./PressableFeedback.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/PressableFeedback/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAChE,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,2BAA2B,CAAA"}
@@ -2,5 +2,4 @@ import * as AppIcons from "./app";
2
2
  import * as ModuleIcons from "./modules";
3
3
  export { AppIcons, ModuleIcons };
4
4
  export * from "./types";
5
- export { Icon } from "../components/Icon";
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,WAAW,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAChC,cAAc,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react-native",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "type": "module",
5
5
  "description": "React Native components for F0 Design System",
6
6
  "main": "expo-router/entry",
@@ -2,7 +2,7 @@ import { render, fireEvent, screen } from "@testing-library/react-native"
2
2
  import React from "react"
3
3
 
4
4
  import { ActivityItem, ActivityItemSkeleton } from "../../Activity/ActivityItem"
5
- import { IconType } from "../../Icon"
5
+ import { type IconType } from "../../primitives/F0Icon"
6
6
 
7
7
  // Mock the IconAvatar component
8
8
  jest.mock("../../Avatars/IconAvatar", () => ({
@@ -2,7 +2,7 @@ import { useState } from "react"
2
2
  import { View, Text, Pressable } from "react-native"
3
3
 
4
4
  import { IconAvatar } from "../../Avatars/exports"
5
- import { IconType } from "../../Icon"
5
+ import { type IconType } from "../../primitives/F0Icon"
6
6
 
7
7
  export type ActivityItemProps = {
8
8
  id: string
@@ -1,7 +1,7 @@
1
1
  import { View } from "react-native"
2
2
 
3
3
  import { cn } from "../../../lib/utils"
4
- import { Icon, IconType } from "../../Icon"
4
+ import { F0Icon, type IconType } from "../../primitives/F0Icon"
5
5
 
6
6
  type Props = {
7
7
  icon: IconType
@@ -24,7 +24,11 @@ export const IconAvatar = ({ icon, size = "md", className }: Props) => {
24
24
  className
25
25
  )}
26
26
  >
27
- <Icon icon={icon} size={size} className="text-f0-foreground-secondary" />
27
+ <F0Icon
28
+ icon={icon}
29
+ size={size}
30
+ className="text-f0-foreground-secondary"
31
+ />
28
32
  </View>
29
33
  )
30
34
  }
@@ -2,7 +2,7 @@ import { View } from "react-native"
2
2
  import Svg, { Defs, LinearGradient, Stop, Path } from "react-native-svg"
3
3
  import { tv, type VariantProps } from "tailwind-variants"
4
4
 
5
- import { IconType, applyIconInterop } from "../../Icon"
5
+ import { type IconType, applyIconInterop } from "../../primitives/F0Icon"
6
6
 
7
7
  import { ModuleId, modules } from "./modules"
8
8
 
@@ -1,6 +1,6 @@
1
1
  import { tv, type VariantProps } from "tailwind-variants"
2
2
 
3
- import { Icon, type IconType } from "../Icon"
3
+ import { F0Icon, type IconType } from "../primitives/F0Icon"
4
4
 
5
5
  const badgeVariants = tv({
6
6
  base: "flex shrink-0 items-center justify-center rounded-full",
@@ -39,7 +39,7 @@ export interface BadgeProps extends VariantProps<typeof badgeVariants> {
39
39
 
40
40
  export const Badge = ({ type, size = "md", icon }: BadgeProps) => {
41
41
  return (
42
- <Icon
42
+ <F0Icon
43
43
  className={badgeVariants({ type, size })}
44
44
  icon={icon}
45
45
  size={iconSizes[size]}
@@ -1,13 +1,12 @@
1
1
  import { render, fireEvent, screen } from "@testing-library/react-native"
2
2
  import React from "react"
3
3
 
4
- import { IconType } from "../Icon"
4
+ import { type IconType } from "../primitives/F0Icon"
5
5
 
6
6
  import { Button } from "./"
7
7
 
8
- // Mock the Icon component
9
- jest.mock("../Icon", () => ({
10
- Icon: () => null,
8
+ jest.mock("../primitives/F0Icon", () => ({
9
+ F0Icon: () => null,
11
10
  }))
12
11
 
13
12
  // Mock dependencies
@@ -3,7 +3,7 @@ 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 { Icon, type IconType } from "../Icon"
6
+ import { F0Icon, type IconType, type IconColor } from "../primitives/F0Icon"
7
7
 
8
8
  export const variants = [
9
9
  "default",
@@ -68,29 +68,35 @@ const pressedVariants = tv({
68
68
  },
69
69
  })
70
70
 
71
- const getIconColor = (variant: ButtonVariant, isPressed: boolean) => {
71
+ const getIconColor = (
72
+ variant: ButtonVariant,
73
+ isPressed: boolean
74
+ ): IconColor => {
72
75
  switch (variant) {
73
76
  case "default":
74
- return "text-f0-icon-inverse"
77
+ return "inverse"
75
78
  case "critical":
76
- return isPressed ? "text-f0-icon-inverse" : "text-f0-icon-critical-bold"
79
+ return isPressed ? "inverse" : "critical-bold"
77
80
  default:
78
- return "text-f0-icon"
81
+ return "default"
79
82
  }
80
83
  }
81
84
 
82
- const getIconOnlyColor = (variant: ButtonVariant, isPressed: boolean) => {
85
+ const getIconOnlyColor = (
86
+ variant: ButtonVariant,
87
+ isPressed: boolean
88
+ ): IconColor => {
83
89
  switch (variant) {
84
90
  case "critical":
85
- return isPressed ? "text-f0-icon-inverse" : "text-f0-icon-critical-bold"
91
+ return isPressed ? "inverse" : "critical-bold"
86
92
  case "default":
87
- return "text-f0-icon-inverse"
93
+ return "inverse"
88
94
  case "outline":
89
95
  case "neutral":
90
96
  case "ghost":
91
97
  case "promote":
92
98
  default:
93
- return "text-f0-icon-bold"
99
+ return "bold"
94
100
  }
95
101
  }
96
102
 
@@ -191,15 +197,15 @@ export const Button = forwardRef<View, ButtonProps>(function Button(
191
197
  accessibilityHint={accessibilityHint}
192
198
  >
193
199
  {icon && (
194
- <Icon
200
+ <F0Icon
195
201
  icon={icon}
196
202
  size={size === "sm" ? "sm" : "md"}
197
- className={cn(
198
- hideLabel && round ? undefined : "-ml-0.5",
203
+ color={
199
204
  hideLabel && round
200
205
  ? getIconOnlyColor(variant, shouldShowPressed)
201
206
  : getIconColor(variant, shouldShowPressed)
202
- )}
207
+ }
208
+ className={hideLabel && round ? undefined : "-ml-0.5"}
203
209
  />
204
210
  )}
205
211
  {emoji && (
@@ -20,8 +20,6 @@ describe("Icon", () => {
20
20
  const { getByTestId } = render(
21
21
  <Icon icon={Archive} size="lg" testID="icon" />
22
22
  )
23
- // In a real test environment, we could check the actual style props applied
24
- // but for now we just ensure it renders
25
23
  expect(getByTestId("icon")).toBeTruthy()
26
24
  })
27
25
 
@@ -29,8 +27,6 @@ describe("Icon", () => {
29
27
  const { getByTestId } = render(
30
28
  <Icon icon={Archive} className="text-red-500" testID="icon" />
31
29
  )
32
- // In a real test environment, we could check the actual style props applied
33
- // but for now we just ensure it renders
34
30
  expect(getByTestId("icon")).toBeTruthy()
35
31
  })
36
32
  })
@@ -1,13 +1,9 @@
1
- import React, {
2
- forwardRef,
3
- ForwardRefExoticComponent,
4
- RefAttributes,
5
- } from "react"
1
+ import React, { forwardRef } from "react"
6
2
  import { Svg, SvgProps } from "react-native-svg"
7
3
  import { tv, type VariantProps } from "tailwind-variants"
8
- import { withUniwind } from "uniwind"
9
4
 
10
5
  import { cn } from "../../lib/utils"
6
+ import { applyIconInterop, type IconType } from "../primitives/F0Icon"
11
7
 
12
8
  const iconVariants = tv({
13
9
  base: "shrink-0",
@@ -33,26 +29,11 @@ export interface IconProps extends SvgProps, VariantProps<typeof iconVariants> {
33
29
  isPressed?: boolean
34
30
  }
35
31
 
36
- export type IconType = ForwardRefExoticComponent<
37
- SvgProps &
38
- RefAttributes<Svg> & {
39
- className?: string
40
- }
41
- >
42
-
43
- // Keep track of icons that have already had withUniwind applied
44
- const interopAppliedIcons = new WeakSet()
45
-
46
- // Function to apply UniWind interop to an icon component
47
- export function applyIconInterop(icon: IconType) {
48
- if (!interopAppliedIcons.has(icon)) {
49
- const wrappedIcon = withUniwind(icon)
50
- interopAppliedIcons.add(wrappedIcon)
51
- return wrappedIcon
52
- }
53
- return icon
54
- }
55
-
32
+ /**
33
+ * @deprecated Use F0Icon instead. This component will be removed in a future version.
34
+ * Migration: Replace <Icon icon={X} /> with <F0Icon icon={X} />.
35
+ * F0Icon supports the same `icon`, `size`, `testID`, and `className` props, plus semantic `color` variants.
36
+ */
56
37
  export const Icon = forwardRef<Svg, IconProps>(function Icon(
57
38
  { size = "md", icon, className, testID, ...props },
58
39
  ref
@@ -3,8 +3,8 @@ import { tv, type VariantProps } from "tailwind-variants"
3
3
 
4
4
  import { CrossedCircle } from "../../icons/app"
5
5
  import { cn } from "../../lib/utils"
6
- import { Icon, type IconType } from "../Icon"
7
- import { PressableFeedback } from "../PressableFeedback"
6
+ import { F0Icon, type IconType } from "../primitives/F0Icon"
7
+ import { PressableFeedback } from "../primitives/PressableFeedback"
8
8
 
9
9
  export const chipContainerVariants = tv({
10
10
  base: "flex items-center gap-1 rounded-full border border-solid border-f0-border px-2 py-0.5 grow-0",
@@ -61,7 +61,7 @@ export const OneChip = ({
61
61
  >
62
62
  <View className="flex flex-row items-center gap-0.5">
63
63
  {icon && (
64
- <Icon
64
+ <F0Icon
65
65
  icon={icon}
66
66
  size="sm"
67
67
  className={chipTextVariants({ variant })}
@@ -78,7 +78,7 @@ export const OneChip = ({
78
78
  accessibilityRole="button"
79
79
  accessibilityLabel="Close"
80
80
  >
81
- <Icon
81
+ <F0Icon
82
82
  icon={CrossedCircle}
83
83
  className={chipTextVariants({ variant })}
84
84
  size="sm"
@@ -2,7 +2,7 @@ import { Text, View } from "react-native"
2
2
 
3
3
  import { cn } from "../../lib/utils"
4
4
  import { Counter } from "../Counter"
5
- import { PressableFeedback } from "../PressableFeedback"
5
+ import { PressableFeedback } from "../primitives/PressableFeedback"
6
6
 
7
7
  interface PresetProps {
8
8
  label: string
@@ -1,7 +1,7 @@
1
1
  import { AlertCircle, InfoCircle, Warning } from "../../../icons/app"
2
2
  import { useTextFormatEnforcer } from "../../../lib/text"
3
3
  import { cn } from "../../../lib/utils"
4
- import { Icon, IconType } from "../../Icon"
4
+ import { F0Icon, type IconType } from "../../primitives/F0Icon"
5
5
  import { BaseTag } from "../BaseTag"
6
6
 
7
7
  type Level = "info" | "warning" | "critical"
@@ -40,7 +40,7 @@ export const AlertTag = <T extends string>({ text, level }: Props<T>) => {
40
40
  }[level]
41
41
  )}
42
42
  left={
43
- <Icon
43
+ <F0Icon
44
44
  icon={iconMap[level]}
45
45
  className={cn(
46
46
  {
@@ -2,7 +2,7 @@ import { ReactNode } from "react"
2
2
  import { Text, View } from "react-native"
3
3
 
4
4
  import { cn } from "../../../lib/utils"
5
- import { PressableFeedback } from "../../PressableFeedback"
5
+ import { PressableFeedback } from "../../primitives/PressableFeedback"
6
6
 
7
7
  type Props = {
8
8
  additionalAccesibleText?: string
@@ -1,6 +1,6 @@
1
1
  import { useTextFormatEnforcer } from "../../../lib/text"
2
2
  import { cn } from "../../../lib/utils"
3
- import { Icon, IconType } from "../../Icon"
3
+ import { F0Icon, type IconType } from "../../primitives/F0Icon"
4
4
  import { BaseTag } from "../BaseTag"
5
5
 
6
6
  export type RawTagProps = {
@@ -29,7 +29,7 @@ export const RawTag = ({
29
29
  classNameText="text-f0-foreground"
30
30
  left={
31
31
  icon ? (
32
- <Icon icon={icon} size="sm" className="text-f0-icon" aria-hidden />
32
+ <F0Icon icon={icon} size="sm" color="default" aria-hidden />
33
33
  ) : null
34
34
  }
35
35
  text={text}
@@ -2,7 +2,7 @@ import { ReactElement, ReactNode } from "react"
2
2
  import { View, Text } from "react-native"
3
3
 
4
4
  import { cn } from "../../../../lib/utils"
5
- import { Icon, IconType } from "../../../Icon"
5
+ import { F0Icon, type IconType } from "../../../primitives/F0Icon"
6
6
 
7
7
  import { CopyAction } from "./actions/CopyAction"
8
8
  import { GenericAction } from "./actions/GenericAction"
@@ -34,7 +34,7 @@ export const ItemContainer = (props: ItemContainerProps) => {
34
34
  (typeof LeftIcon === "function" ? (
35
35
  LeftIcon({})
36
36
  ) : (
37
- <Icon icon={LeftIcon} size="md" />
37
+ <F0Icon icon={LeftIcon} size="md" />
38
38
  ))}
39
39
  <Text className="line-clamp-5 text-left text-f0-foreground">
40
40
  {text}
@@ -5,7 +5,7 @@ import { Pressable, View } from "react-native"
5
5
  import { CopyActionType } from ".."
6
6
  import { CheckCircle, LayersFront } from "../../../../../icons/app"
7
7
  import { cn } from "../../../../../lib/utils"
8
- import { Icon } from "../../../../Icon"
8
+ import { F0Icon } from "../../../../primitives/F0Icon"
9
9
 
10
10
  const COPIED_SHOWN_MS = 750
11
11
 
@@ -47,24 +47,21 @@ export const CopyAction = ({ text, children }: CopyActionProps) => {
47
47
  <View className="flex flex-row items-center gap-1.5">{children}</View>
48
48
  <View className="flex">
49
49
  {!copied && (
50
- <Icon
50
+ <F0Icon
51
51
  icon={LayersFront}
52
52
  size="md"
53
53
  aria-hidden={true}
54
- className={cn(
55
- "col-start-1 col-end-2 row-start-1 row-end-2 text-f0-icon-bold"
56
- )}
54
+ color="bold"
55
+ className="col-start-1 col-end-2 row-start-1 row-end-2"
57
56
  />
58
57
  )}
59
58
  {copied && (
60
- <Icon
59
+ <F0Icon
61
60
  icon={CheckCircle}
62
61
  size="md"
63
62
  aria-hidden={true}
64
- className={cn(
65
- "col-start-1 col-end-2 row-start-1 row-end-2",
66
- "text-f0-icon-positive"
67
- )}
63
+ color="positive"
64
+ className="col-start-1 col-end-2 row-start-1 row-end-2"
68
65
  />
69
66
  )}
70
67
  </View>