@momo-kits/foundation 0.169.7 → 0.169.8

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.
@@ -73,6 +73,9 @@ type ModalLayoutInput = {
73
73
  hinge?: ReservedRegion;
74
74
  };
75
75
 
76
+ /**
77
+ * `value` limited to the `[min, max]` range.
78
+ */
76
79
  const clamp = (value: number, min: number, max: number) => {
77
80
  return Math.min(Math.max(value, min), max);
78
81
  };
@@ -150,7 +150,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
150
150
  return text;
151
151
  }
152
152
  return segments.map((segment, index) => {
153
- if (segment.highlight) {
153
+ if (segment.isHighlighted) {
154
154
  return (
155
155
  <Text key={index} typography={'header_s_semibold'}>
156
156
  {segment.text}
package/Popup/utils.ts CHANGED
@@ -1,4 +1,4 @@
1
- type HighlightSegment = { text: string; highlight: boolean };
1
+ type HighlightSegment = { text: string; isHighlighted: boolean };
2
2
 
3
3
  /**
4
4
  * True for cased-script letters, digits and `_`; caseless scripts (CJK, Thai)
@@ -46,12 +46,15 @@ const splitHighlightText = (
46
46
  continue;
47
47
  }
48
48
  if (start > lastIndex) {
49
- segments.push({ text: text.slice(lastIndex, start), highlight: false });
49
+ segments.push({
50
+ text: text.slice(lastIndex, start),
51
+ isHighlighted: false,
52
+ });
50
53
  }
51
- segments.push({ text: match[0], highlight: true });
54
+ segments.push({ text: match[0], isHighlighted: true });
52
55
  lastIndex = end;
53
56
  }
54
- segments.push({ text: text.slice(lastIndex), highlight: false });
57
+ segments.push({ text: text.slice(lastIndex), isHighlighted: false });
55
58
  return segments;
56
59
  };
57
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.169.7",
3
+ "version": "0.169.8",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},