@momo-kits/collapse 0.77.5 → 0.77.7

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 (3) hide show
  1. package/index.tsx +1 -1
  2. package/package.json +1 -1
  3. package/types.ts +34 -2
package/index.tsx CHANGED
@@ -85,7 +85,7 @@ const Collapse: FC<CollapseProps> = ({
85
85
  },
86
86
  expanded && radiusStyle,
87
87
  ]}>
88
- {!!image && <Image source={image} style={styles.image} />}
88
+ {!!image && <Image source={{uri: image}} style={styles.image} />}
89
89
  <View style={styles.headerContent}>
90
90
  <Text numberOfLines={1} typography={'header_default'}>
91
91
  {title}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/collapse",
3
- "version": "0.77.5",
3
+ "version": "0.77.7",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "peerDependencies": {
package/types.ts CHANGED
@@ -1,8 +1,40 @@
1
- import {Source} from 'react-native-fast-image';
1
+ /**
2
+ * Props for the Collapse component. The Collapse component is an interactive component
3
+ * typically used to show and hide content via user interaction, often used for FAQs,
4
+ * toggles, or detailed breakdowns in a condensed space.
5
+ */
2
6
  export type CollapseProps = {
7
+ /**
8
+ * The title represents what is being collapsed or expanded. It is usually a summary or
9
+ * a brief heading corresponding to the detailed content that gets revealed.
10
+ */
3
11
  title: string;
12
+
13
+ /**
14
+ * Optional. A more detailed explanation or continuation of the title. This text provides
15
+ * additional context or information, which is particularly useful when the collapsed content
16
+ * is not immediately visible or requires extra explanation.
17
+ */
4
18
  description?: string;
5
- image?: number | Source;
19
+
20
+ /**
21
+ * Optional. The URL or local file path of an image to be displayed. This feature is often
22
+ * used to provide a visual context or decoration, enhancing user engagement or understanding
23
+ * of the information being toggled.
24
+ */
25
+ image?: string;
26
+
27
+ /**
28
+ * Optional. A callback function that is triggered when the collapse component is pressed or
29
+ * selected. This function is typically used to toggle the view state of the collapsible content.
30
+ */
6
31
  onPress?: () => void;
32
+
33
+ /**
34
+ * Optional. If `true`, a border is displayed around the collapse component, visually separating
35
+ * it from other UI elements. This is particularly useful in densely packed interfaces to delineate
36
+ * between different sections.
37
+ * Defaults to `false` if not provided.
38
+ */
7
39
  showBorder?: boolean;
8
40
  };