@buoy-gg/storage 1.7.2

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 (187) hide show
  1. package/README.md +607 -0
  2. package/lib/commonjs/index.js +34 -0
  3. package/lib/commonjs/package.json +1 -0
  4. package/lib/commonjs/preset.js +94 -0
  5. package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +356 -0
  6. package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +29 -0
  7. package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +121 -0
  8. package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +419 -0
  9. package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +122 -0
  10. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +924 -0
  11. package/lib/commonjs/storage/components/GameUIStorageStats.js +746 -0
  12. package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +257 -0
  13. package/lib/commonjs/storage/components/MMKVInstanceSelector.js +418 -0
  14. package/lib/commonjs/storage/components/SelectionActionBar.js +224 -0
  15. package/lib/commonjs/storage/components/StorageActionButtons.js +239 -0
  16. package/lib/commonjs/storage/components/StorageActions.js +192 -0
  17. package/lib/commonjs/storage/components/StorageBrowserMode.js +31 -0
  18. package/lib/commonjs/storage/components/StorageEventDetailContent.js +1025 -0
  19. package/lib/commonjs/storage/components/StorageEventFilterView.js +141 -0
  20. package/lib/commonjs/storage/components/StorageEventListener.js +357 -0
  21. package/lib/commonjs/storage/components/StorageEventsSection.js +24 -0
  22. package/lib/commonjs/storage/components/StorageFilterCards.js +345 -0
  23. package/lib/commonjs/storage/components/StorageFilterViewV2.js +42 -0
  24. package/lib/commonjs/storage/components/StorageKeyCard.js +516 -0
  25. package/lib/commonjs/storage/components/StorageKeyRow.js +356 -0
  26. package/lib/commonjs/storage/components/StorageKeySection.js +105 -0
  27. package/lib/commonjs/storage/components/StorageKeyStats.js +344 -0
  28. package/lib/commonjs/storage/components/StorageModalWithTabs.js +871 -0
  29. package/lib/commonjs/storage/components/StorageSection.js +43 -0
  30. package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +126 -0
  31. package/lib/commonjs/storage/hooks/useMMKVInstances.js +221 -0
  32. package/lib/commonjs/storage/hooks/useMMKVKeys.js +362 -0
  33. package/lib/commonjs/storage/hooks/useTickEverySecond.js +21 -0
  34. package/lib/commonjs/storage/index.js +148 -0
  35. package/lib/commonjs/storage/types.js +5 -0
  36. package/lib/commonjs/storage/utils/AsyncStorageListener.js +510 -0
  37. package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +202 -0
  38. package/lib/commonjs/storage/utils/MMKVListener.js +380 -0
  39. package/lib/commonjs/storage/utils/clearAllStorage.js +47 -0
  40. package/lib/commonjs/storage/utils/index.js +180 -0
  41. package/lib/commonjs/storage/utils/lineDiff.js +363 -0
  42. package/lib/commonjs/storage/utils/mmkvAvailability.js +62 -0
  43. package/lib/commonjs/storage/utils/mmkvTypeDetection.js +139 -0
  44. package/lib/commonjs/storage/utils/objectDiff.js +157 -0
  45. package/lib/commonjs/storage/utils/safeAsyncStorage.js +140 -0
  46. package/lib/commonjs/storage/utils/storageActionHelpers.js +46 -0
  47. package/lib/commonjs/storage/utils/storageQueryUtils.js +35 -0
  48. package/lib/commonjs/storage/utils/valueType.js +18 -0
  49. package/lib/module/index.js +7 -0
  50. package/lib/module/preset.js +89 -0
  51. package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +352 -0
  52. package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +25 -0
  53. package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +117 -0
  54. package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +415 -0
  55. package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +118 -0
  56. package/lib/module/storage/components/GameUIStorageBrowser.js +922 -0
  57. package/lib/module/storage/components/GameUIStorageStats.js +742 -0
  58. package/lib/module/storage/components/MMKVInstanceInfoPanel.js +253 -0
  59. package/lib/module/storage/components/MMKVInstanceSelector.js +414 -0
  60. package/lib/module/storage/components/SelectionActionBar.js +221 -0
  61. package/lib/module/storage/components/StorageActionButtons.js +236 -0
  62. package/lib/module/storage/components/StorageActions.js +189 -0
  63. package/lib/module/storage/components/StorageBrowserMode.js +27 -0
  64. package/lib/module/storage/components/StorageEventDetailContent.js +1020 -0
  65. package/lib/module/storage/components/StorageEventFilterView.js +137 -0
  66. package/lib/module/storage/components/StorageEventListener.js +354 -0
  67. package/lib/module/storage/components/StorageEventsSection.js +20 -0
  68. package/lib/module/storage/components/StorageFilterCards.js +341 -0
  69. package/lib/module/storage/components/StorageFilterViewV2.js +38 -0
  70. package/lib/module/storage/components/StorageKeyCard.js +513 -0
  71. package/lib/module/storage/components/StorageKeyRow.js +353 -0
  72. package/lib/module/storage/components/StorageKeySection.js +101 -0
  73. package/lib/module/storage/components/StorageKeyStats.js +340 -0
  74. package/lib/module/storage/components/StorageModalWithTabs.js +867 -0
  75. package/lib/module/storage/components/StorageSection.js +40 -0
  76. package/lib/module/storage/hooks/useAsyncStorageKeys.js +121 -0
  77. package/lib/module/storage/hooks/useMMKVInstances.js +216 -0
  78. package/lib/module/storage/hooks/useMMKVKeys.js +359 -0
  79. package/lib/module/storage/hooks/useTickEverySecond.js +18 -0
  80. package/lib/module/storage/index.js +25 -0
  81. package/lib/module/storage/types.js +3 -0
  82. package/lib/module/storage/utils/AsyncStorageListener.js +500 -0
  83. package/lib/module/storage/utils/MMKVInstanceRegistry.js +196 -0
  84. package/lib/module/storage/utils/MMKVListener.js +367 -0
  85. package/lib/module/storage/utils/clearAllStorage.js +42 -0
  86. package/lib/module/storage/utils/index.js +22 -0
  87. package/lib/module/storage/utils/lineDiff.js +359 -0
  88. package/lib/module/storage/utils/mmkvAvailability.js +56 -0
  89. package/lib/module/storage/utils/mmkvTypeDetection.js +133 -0
  90. package/lib/module/storage/utils/objectDiff.js +153 -0
  91. package/lib/module/storage/utils/safeAsyncStorage.js +134 -0
  92. package/lib/module/storage/utils/storageActionHelpers.js +42 -0
  93. package/lib/module/storage/utils/storageQueryUtils.js +30 -0
  94. package/lib/module/storage/utils/valueType.js +14 -0
  95. package/lib/typescript/index.d.ts +3 -0
  96. package/lib/typescript/index.d.ts.map +1 -0
  97. package/lib/typescript/preset.d.ts +90 -0
  98. package/lib/typescript/preset.d.ts.map +1 -0
  99. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +18 -0
  100. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +1 -0
  101. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts +7 -0
  102. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +1 -0
  103. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +12 -0
  104. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +1 -0
  105. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts +13 -0
  106. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +1 -0
  107. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts +64 -0
  108. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +1 -0
  109. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts +16 -0
  110. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -0
  111. package/lib/typescript/storage/components/GameUIStorageStats.d.ts +7 -0
  112. package/lib/typescript/storage/components/GameUIStorageStats.d.ts.map +1 -0
  113. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts +42 -0
  114. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +1 -0
  115. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +35 -0
  116. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +1 -0
  117. package/lib/typescript/storage/components/SelectionActionBar.d.ts +21 -0
  118. package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +1 -0
  119. package/lib/typescript/storage/components/StorageActionButtons.d.ts +21 -0
  120. package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +1 -0
  121. package/lib/typescript/storage/components/StorageActions.d.ts +10 -0
  122. package/lib/typescript/storage/components/StorageActions.d.ts.map +1 -0
  123. package/lib/typescript/storage/components/StorageBrowserMode.d.ts +18 -0
  124. package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +1 -0
  125. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts +40 -0
  126. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +1 -0
  127. package/lib/typescript/storage/components/StorageEventFilterView.d.ts +11 -0
  128. package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +1 -0
  129. package/lib/typescript/storage/components/StorageEventListener.d.ts +6 -0
  130. package/lib/typescript/storage/components/StorageEventListener.d.ts.map +1 -0
  131. package/lib/typescript/storage/components/StorageEventsSection.d.ts +7 -0
  132. package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +1 -0
  133. package/lib/typescript/storage/components/StorageFilterCards.d.ts +36 -0
  134. package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +1 -0
  135. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts +9 -0
  136. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts.map +1 -0
  137. package/lib/typescript/storage/components/StorageKeyCard.d.ts +17 -0
  138. package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +1 -0
  139. package/lib/typescript/storage/components/StorageKeyRow.d.ts +15 -0
  140. package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +1 -0
  141. package/lib/typescript/storage/components/StorageKeySection.d.ts +25 -0
  142. package/lib/typescript/storage/components/StorageKeySection.d.ts.map +1 -0
  143. package/lib/typescript/storage/components/StorageKeyStats.d.ts +15 -0
  144. package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +1 -0
  145. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts +13 -0
  146. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -0
  147. package/lib/typescript/storage/components/StorageSection.d.ts +10 -0
  148. package/lib/typescript/storage/components/StorageSection.d.ts.map +1 -0
  149. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts +10 -0
  150. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +1 -0
  151. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts +114 -0
  152. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +1 -0
  153. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts +94 -0
  154. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +1 -0
  155. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts +6 -0
  156. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts.map +1 -0
  157. package/lib/typescript/storage/index.d.ts +15 -0
  158. package/lib/typescript/storage/index.d.ts.map +1 -0
  159. package/lib/typescript/storage/types.d.ts +41 -0
  160. package/lib/typescript/storage/types.d.ts.map +1 -0
  161. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts +195 -0
  162. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +1 -0
  163. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts +224 -0
  164. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +1 -0
  165. package/lib/typescript/storage/utils/MMKVListener.d.ts +218 -0
  166. package/lib/typescript/storage/utils/MMKVListener.d.ts.map +1 -0
  167. package/lib/typescript/storage/utils/clearAllStorage.d.ts +11 -0
  168. package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +1 -0
  169. package/lib/typescript/storage/utils/index.d.ts +8 -0
  170. package/lib/typescript/storage/utils/index.d.ts.map +1 -0
  171. package/lib/typescript/storage/utils/lineDiff.d.ts +34 -0
  172. package/lib/typescript/storage/utils/lineDiff.d.ts.map +1 -0
  173. package/lib/typescript/storage/utils/mmkvAvailability.d.ts +23 -0
  174. package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +1 -0
  175. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts +71 -0
  176. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +1 -0
  177. package/lib/typescript/storage/utils/objectDiff.d.ts +35 -0
  178. package/lib/typescript/storage/utils/objectDiff.d.ts.map +1 -0
  179. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts +56 -0
  180. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts.map +1 -0
  181. package/lib/typescript/storage/utils/storageActionHelpers.d.ts +5 -0
  182. package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +1 -0
  183. package/lib/typescript/storage/utils/storageQueryUtils.d.ts +6 -0
  184. package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +1 -0
  185. package/lib/typescript/storage/utils/valueType.d.ts +3 -0
  186. package/lib/typescript/storage/utils/valueType.d.ts.map +1 -0
  187. package/package.json +68 -0
@@ -0,0 +1,344 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StorageKeyStatsSection = StorageKeyStatsSection;
7
+ var _reactNative = require("react-native");
8
+ var _sharedUi = require("@buoy-gg/shared-ui");
9
+ var _storageQueryUtils = require("../utils/storageQueryUtils");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ // Variable type configurations matching env vars design
12
+ const variableTypeData = [{
13
+ key: "valid",
14
+ label: "Valid Keys",
15
+ description: "Correctly stored and accessible",
16
+ icon: _sharedUi.CheckCircle2,
17
+ color: "#10B981",
18
+ textColor: "#10B981",
19
+ bgColor: "rgba(16, 185, 129, 0.1)"
20
+ }, {
21
+ key: "missing",
22
+ label: "Missing Keys",
23
+ description: "Required but not found",
24
+ icon: _sharedUi.AlertCircle,
25
+ color: "#EF4444",
26
+ textColor: "#EF4444",
27
+ bgColor: "rgba(239, 68, 68, 0.1)"
28
+ }, {
29
+ key: "wrongValue",
30
+ label: "Wrong Values",
31
+ description: "Stored but incorrect value",
32
+ icon: _sharedUi.XCircle,
33
+ color: "#F97316",
34
+ textColor: "#F97316",
35
+ bgColor: "rgba(249, 115, 22, 0.1)"
36
+ }, {
37
+ key: "wrongType",
38
+ label: "Wrong Types",
39
+ description: "Value has incorrect data type",
40
+ icon: _sharedUi.XCircle,
41
+ color: "#0891B2",
42
+ textColor: "#0891B2",
43
+ bgColor: "rgba(8, 145, 178, 0.1)"
44
+ }, {
45
+ key: "optional",
46
+ label: "Optional Keys",
47
+ description: "Available but not required",
48
+ icon: _sharedUi.Eye,
49
+ color: "#8B5CF6",
50
+ textColor: "#8B5CF6",
51
+ bgColor: "rgba(139, 92, 246, 0.1)"
52
+ }];
53
+
54
+ // Storage type breakdown data
55
+ const storageTypeData = [{
56
+ key: "mmkv",
57
+ label: "MMKV",
58
+ description: "High-performance key-value storage",
59
+ icon: _sharedUi.Database
60
+ }, {
61
+ key: "async",
62
+ label: "AsyncStorage",
63
+ description: "React Native async storage",
64
+ icon: _sharedUi.Database
65
+ }, {
66
+ key: "secure",
67
+ label: "SecureStorage",
68
+ description: "Encrypted secure storage",
69
+ icon: _sharedUi.Shield
70
+ }];
71
+
72
+ /**
73
+ * Storage key stats component following composition principles [[rule3]]
74
+ *
75
+ * Applied principles:
76
+ * - Decompose by Responsibility: Single purpose component for storage stats display
77
+ * - Prefer Composition over Configuration: Reuses patterns from EnvVarStats
78
+ * - Extract Reusable Logic: Shares visualization patterns with env vars
79
+ */
80
+ function StorageKeyStatsSection({
81
+ stats
82
+ }) {
83
+ const {
84
+ totalCount,
85
+ missingCount,
86
+ wrongValueCount,
87
+ wrongTypeCount,
88
+ presentRequiredCount,
89
+ optionalCount,
90
+ mmkvCount,
91
+ asyncCount,
92
+ secureCount
93
+ } = stats;
94
+
95
+ // If no storage keys at all, show minimal stats
96
+ if (totalCount === 0) {
97
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
98
+ style: styles.statsContainer,
99
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
100
+ style: styles.sectionTitle,
101
+ children: "STORAGE BREAKDOWN"
102
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
103
+ style: styles.emptyState,
104
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
105
+ style: styles.emptyStateText,
106
+ children: "No storage keys detected"
107
+ })
108
+ })]
109
+ });
110
+ }
111
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
112
+ style: styles.statsContainer,
113
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
114
+ style: styles.breakdownSection,
115
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
116
+ style: styles.sectionTitle,
117
+ children: "KEY STATUS BREAKDOWN"
118
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
119
+ style: styles.breakdownList,
120
+ children: variableTypeData.map(item => {
121
+ let count = 0;
122
+ let shouldShow = false;
123
+ switch (item.key) {
124
+ case "valid":
125
+ count = presentRequiredCount;
126
+ shouldShow = count > 0;
127
+ break;
128
+ case "missing":
129
+ count = missingCount;
130
+ shouldShow = count > 0;
131
+ break;
132
+ case "wrongValue":
133
+ count = wrongValueCount;
134
+ shouldShow = count > 0;
135
+ break;
136
+ case "wrongType":
137
+ count = wrongTypeCount;
138
+ shouldShow = count > 0;
139
+ break;
140
+ case "optional":
141
+ count = optionalCount;
142
+ shouldShow = count > 0;
143
+ break;
144
+ }
145
+ if (!shouldShow) return null;
146
+ const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
147
+ const IconComponent = item.icon;
148
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
149
+ style: styles.breakdownItem,
150
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
151
+ style: styles.breakdownItemRow,
152
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
153
+ style: styles.breakdownItemLeft,
154
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
155
+ style: [styles.breakdownIcon, {
156
+ backgroundColor: item.bgColor
157
+ }],
158
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
159
+ size: 14,
160
+ color: item.color
161
+ })
162
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
163
+ style: styles.breakdownItemInfo,
164
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
165
+ style: styles.breakdownItemLabel,
166
+ children: item.label
167
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
168
+ style: styles.breakdownItemDesc,
169
+ children: item.description
170
+ })]
171
+ })]
172
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
173
+ style: styles.breakdownItemRight,
174
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
175
+ style: [styles.breakdownCount, {
176
+ color: item.textColor
177
+ }],
178
+ children: count
179
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
180
+ style: styles.breakdownPercentage,
181
+ children: [percentage, "%"]
182
+ })]
183
+ })]
184
+ })
185
+ }, item.key);
186
+ })
187
+ })]
188
+ }), (mmkvCount > 0 || asyncCount > 0 || secureCount > 0) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
189
+ style: styles.breakdownSection,
190
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
191
+ style: styles.sectionTitle,
192
+ children: "STORAGE TYPE BREAKDOWN"
193
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
194
+ style: styles.breakdownList,
195
+ children: storageTypeData.map(item => {
196
+ let count = 0;
197
+ let shouldShow = false;
198
+ switch (item.key) {
199
+ case "mmkv":
200
+ count = mmkvCount;
201
+ shouldShow = count > 0;
202
+ break;
203
+ case "async":
204
+ count = asyncCount;
205
+ shouldShow = count > 0;
206
+ break;
207
+ case "secure":
208
+ count = secureCount;
209
+ shouldShow = count > 0;
210
+ break;
211
+ }
212
+ if (!shouldShow) return null;
213
+ const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
214
+ const IconComponent = item.icon;
215
+ const storageColor = (0, _storageQueryUtils.getStorageTypeHexColor)(item.key);
216
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
217
+ style: styles.breakdownItem,
218
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
219
+ style: styles.breakdownItemRow,
220
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
221
+ style: styles.breakdownItemLeft,
222
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
223
+ style: [styles.breakdownIcon, {
224
+ backgroundColor: `${storageColor}15`
225
+ }],
226
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
227
+ size: 14,
228
+ color: storageColor
229
+ })
230
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
231
+ style: styles.breakdownItemInfo,
232
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
233
+ style: styles.breakdownItemLabel,
234
+ children: item.label
235
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
236
+ style: styles.breakdownItemDesc,
237
+ children: item.description
238
+ })]
239
+ })]
240
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
241
+ style: styles.breakdownItemRight,
242
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
243
+ style: [styles.breakdownCount, {
244
+ color: storageColor
245
+ }],
246
+ children: count
247
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
248
+ style: styles.breakdownPercentage,
249
+ children: [percentage, "%"]
250
+ })]
251
+ })]
252
+ })
253
+ }, item.key);
254
+ })
255
+ })]
256
+ })]
257
+ });
258
+ }
259
+ const styles = _reactNative.StyleSheet.create({
260
+ statsContainer: {
261
+ marginBottom: 24,
262
+ backgroundColor: "rgba(255, 255, 255, 0.03)",
263
+ borderRadius: 8,
264
+ padding: 16,
265
+ borderWidth: 1,
266
+ borderColor: "rgba(255, 255, 255, 0.08)"
267
+ },
268
+ // Section titles
269
+ sectionTitle: {
270
+ color: "#9CA3AF",
271
+ fontSize: 12,
272
+ fontWeight: "500",
273
+ marginBottom: 16,
274
+ textTransform: "uppercase",
275
+ letterSpacing: 0.5
276
+ },
277
+ // Breakdown section
278
+ breakdownSection: {
279
+ gap: 12,
280
+ marginBottom: 20
281
+ },
282
+ breakdownList: {
283
+ gap: 12
284
+ },
285
+ breakdownItem: {
286
+ backgroundColor: "rgba(255, 255, 255, 0.02)",
287
+ padding: 12,
288
+ borderRadius: 8,
289
+ borderWidth: 1,
290
+ borderColor: "rgba(255, 255, 255, 0.05)"
291
+ },
292
+ breakdownItemRow: {
293
+ flexDirection: "row",
294
+ alignItems: "center",
295
+ justifyContent: "space-between"
296
+ },
297
+ breakdownItemLeft: {
298
+ flexDirection: "row",
299
+ alignItems: "center",
300
+ gap: 12,
301
+ flex: 1,
302
+ minWidth: 0
303
+ },
304
+ breakdownIcon: {
305
+ padding: 8,
306
+ borderRadius: 8
307
+ },
308
+ breakdownItemInfo: {
309
+ flex: 1,
310
+ minWidth: 0
311
+ },
312
+ breakdownItemLabel: {
313
+ color: "#FFFFFF",
314
+ fontSize: 14,
315
+ fontWeight: "500"
316
+ },
317
+ breakdownItemDesc: {
318
+ color: "#9CA3AF",
319
+ fontSize: 12
320
+ },
321
+ breakdownItemRight: {
322
+ alignItems: "flex-end"
323
+ },
324
+ breakdownCount: {
325
+ fontSize: 16,
326
+ fontWeight: "600"
327
+ },
328
+ breakdownPercentage: {
329
+ color: "#6B7280",
330
+ fontSize: 10
331
+ },
332
+ // Empty state
333
+ emptyState: {
334
+ padding: 16,
335
+ backgroundColor: "rgba(255, 255, 255, 0.02)",
336
+ borderRadius: 6,
337
+ alignItems: "center"
338
+ },
339
+ emptyStateText: {
340
+ color: "#6B7280",
341
+ fontSize: 11,
342
+ textAlign: "center"
343
+ }
344
+ });