@oxyhq/bloom 0.29.5 → 0.30.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 (199) hide show
  1. package/lib/commonjs/activity-heatmap/ActivityHeatmap.js +304 -0
  2. package/lib/commonjs/activity-heatmap/ActivityHeatmap.js.map +1 -0
  3. package/lib/commonjs/activity-heatmap/bucketByDay.js +51 -0
  4. package/lib/commonjs/activity-heatmap/bucketByDay.js.map +1 -0
  5. package/lib/commonjs/activity-heatmap/index.js +20 -0
  6. package/lib/commonjs/activity-heatmap/index.js.map +1 -0
  7. package/lib/commonjs/activity-heatmap/types.js +6 -0
  8. package/lib/commonjs/activity-heatmap/types.js.map +1 -0
  9. package/lib/commonjs/avatar-group/AvatarGroupBase.js +42 -18
  10. package/lib/commonjs/avatar-group/AvatarGroupBase.js.map +1 -1
  11. package/lib/commonjs/composition-bar/CompositionBar.js +159 -0
  12. package/lib/commonjs/composition-bar/CompositionBar.js.map +1 -0
  13. package/lib/commonjs/composition-bar/index.js +13 -0
  14. package/lib/commonjs/composition-bar/index.js.map +1 -0
  15. package/lib/commonjs/composition-bar/types.js +6 -0
  16. package/lib/commonjs/composition-bar/types.js.map +1 -0
  17. package/lib/commonjs/dot-grid-meter/DotGridMeter.js +69 -0
  18. package/lib/commonjs/dot-grid-meter/DotGridMeter.js.map +1 -0
  19. package/lib/commonjs/dot-grid-meter/index.js +13 -0
  20. package/lib/commonjs/dot-grid-meter/index.js.map +1 -0
  21. package/lib/commonjs/dot-grid-meter/types.js +6 -0
  22. package/lib/commonjs/dot-grid-meter/types.js.map +1 -0
  23. package/lib/commonjs/index.js +59 -12
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/index.web.js +59 -12
  26. package/lib/commonjs/index.web.js.map +1 -1
  27. package/lib/commonjs/profile-card/ProfileCard.js +301 -0
  28. package/lib/commonjs/profile-card/ProfileCard.js.map +1 -0
  29. package/lib/commonjs/profile-card/index.js +13 -0
  30. package/lib/commonjs/profile-card/index.js.map +1 -0
  31. package/lib/commonjs/profile-card/types.js +6 -0
  32. package/lib/commonjs/profile-card/types.js.map +1 -0
  33. package/lib/commonjs/stat-bar/StatBar.js +210 -0
  34. package/lib/commonjs/stat-bar/StatBar.js.map +1 -0
  35. package/lib/commonjs/stat-bar/index.js +13 -0
  36. package/lib/commonjs/stat-bar/index.js.map +1 -0
  37. package/lib/commonjs/stat-bar/types.js +6 -0
  38. package/lib/commonjs/stat-bar/types.js.map +1 -0
  39. package/lib/commonjs/typography/index.js +4 -5
  40. package/lib/commonjs/typography/index.js.map +1 -1
  41. package/lib/commonjs/typography/styled-text.js +12 -19
  42. package/lib/commonjs/typography/styled-text.js.map +1 -1
  43. package/lib/module/activity-heatmap/ActivityHeatmap.js +299 -0
  44. package/lib/module/activity-heatmap/ActivityHeatmap.js.map +1 -0
  45. package/lib/module/activity-heatmap/bucketByDay.js +47 -0
  46. package/lib/module/activity-heatmap/bucketByDay.js.map +1 -0
  47. package/lib/module/activity-heatmap/index.js +5 -0
  48. package/lib/module/activity-heatmap/index.js.map +1 -0
  49. package/lib/module/activity-heatmap/types.js +4 -0
  50. package/lib/module/activity-heatmap/types.js.map +1 -0
  51. package/lib/module/avatar-group/AvatarGroupBase.js +42 -18
  52. package/lib/module/avatar-group/AvatarGroupBase.js.map +1 -1
  53. package/lib/module/composition-bar/CompositionBar.js +154 -0
  54. package/lib/module/composition-bar/CompositionBar.js.map +1 -0
  55. package/lib/module/composition-bar/index.js +4 -0
  56. package/lib/module/composition-bar/index.js.map +1 -0
  57. package/lib/module/composition-bar/types.js +4 -0
  58. package/lib/module/composition-bar/types.js.map +1 -0
  59. package/lib/module/dot-grid-meter/DotGridMeter.js +64 -0
  60. package/lib/module/dot-grid-meter/DotGridMeter.js.map +1 -0
  61. package/lib/module/dot-grid-meter/index.js +4 -0
  62. package/lib/module/dot-grid-meter/index.js.map +1 -0
  63. package/lib/module/dot-grid-meter/types.js +4 -0
  64. package/lib/module/dot-grid-meter/types.js.map +1 -0
  65. package/lib/module/index.js +6 -0
  66. package/lib/module/index.js.map +1 -1
  67. package/lib/module/index.web.js +6 -0
  68. package/lib/module/index.web.js.map +1 -1
  69. package/lib/module/profile-card/ProfileCard.js +296 -0
  70. package/lib/module/profile-card/ProfileCard.js.map +1 -0
  71. package/lib/module/profile-card/index.js +4 -0
  72. package/lib/module/profile-card/index.js.map +1 -0
  73. package/lib/module/profile-card/types.js +4 -0
  74. package/lib/module/profile-card/types.js.map +1 -0
  75. package/lib/module/stat-bar/StatBar.js +205 -0
  76. package/lib/module/stat-bar/StatBar.js.map +1 -0
  77. package/lib/module/stat-bar/index.js +4 -0
  78. package/lib/module/stat-bar/index.js.map +1 -0
  79. package/lib/module/stat-bar/types.js +4 -0
  80. package/lib/module/stat-bar/types.js.map +1 -0
  81. package/lib/module/typography/index.js +5 -6
  82. package/lib/module/typography/index.js.map +1 -1
  83. package/lib/module/typography/styled-text.js +12 -19
  84. package/lib/module/typography/styled-text.js.map +1 -1
  85. package/lib/typescript/commonjs/activity-heatmap/ActivityHeatmap.d.ts +4 -0
  86. package/lib/typescript/commonjs/activity-heatmap/ActivityHeatmap.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/activity-heatmap/bucketByDay.d.ts +9 -0
  88. package/lib/typescript/commonjs/activity-heatmap/bucketByDay.d.ts.map +1 -0
  89. package/lib/typescript/commonjs/activity-heatmap/index.d.ts +4 -0
  90. package/lib/typescript/commonjs/activity-heatmap/index.d.ts.map +1 -0
  91. package/lib/typescript/commonjs/activity-heatmap/types.d.ts +73 -0
  92. package/lib/typescript/commonjs/activity-heatmap/types.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/avatar-group/AvatarGroupBase.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/avatar-group/types.d.ts +15 -1
  95. package/lib/typescript/commonjs/avatar-group/types.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/composition-bar/CompositionBar.d.ts +4 -0
  97. package/lib/typescript/commonjs/composition-bar/CompositionBar.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/composition-bar/index.d.ts +3 -0
  99. package/lib/typescript/commonjs/composition-bar/index.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/composition-bar/types.d.ts +29 -0
  101. package/lib/typescript/commonjs/composition-bar/types.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/dot-grid-meter/DotGridMeter.d.ts +4 -0
  103. package/lib/typescript/commonjs/dot-grid-meter/DotGridMeter.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/dot-grid-meter/index.d.ts +3 -0
  105. package/lib/typescript/commonjs/dot-grid-meter/index.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/dot-grid-meter/types.d.ts +36 -0
  107. package/lib/typescript/commonjs/dot-grid-meter/types.d.ts.map +1 -0
  108. package/lib/typescript/commonjs/index.d.ts +10 -0
  109. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/index.web.d.ts +10 -0
  111. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/profile-card/ProfileCard.d.ts +4 -0
  113. package/lib/typescript/commonjs/profile-card/ProfileCard.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/profile-card/index.d.ts +3 -0
  115. package/lib/typescript/commonjs/profile-card/index.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/profile-card/types.d.ts +86 -0
  117. package/lib/typescript/commonjs/profile-card/types.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/stat-bar/StatBar.d.ts +4 -0
  119. package/lib/typescript/commonjs/stat-bar/StatBar.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/stat-bar/index.d.ts +3 -0
  121. package/lib/typescript/commonjs/stat-bar/index.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/stat-bar/types.d.ts +62 -0
  123. package/lib/typescript/commonjs/stat-bar/types.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/typography/index.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/typography/styled-text.d.ts +1 -6
  126. package/lib/typescript/commonjs/typography/styled-text.d.ts.map +1 -1
  127. package/lib/typescript/module/activity-heatmap/ActivityHeatmap.d.ts +4 -0
  128. package/lib/typescript/module/activity-heatmap/ActivityHeatmap.d.ts.map +1 -0
  129. package/lib/typescript/module/activity-heatmap/bucketByDay.d.ts +9 -0
  130. package/lib/typescript/module/activity-heatmap/bucketByDay.d.ts.map +1 -0
  131. package/lib/typescript/module/activity-heatmap/index.d.ts +4 -0
  132. package/lib/typescript/module/activity-heatmap/index.d.ts.map +1 -0
  133. package/lib/typescript/module/activity-heatmap/types.d.ts +73 -0
  134. package/lib/typescript/module/activity-heatmap/types.d.ts.map +1 -0
  135. package/lib/typescript/module/avatar-group/AvatarGroupBase.d.ts.map +1 -1
  136. package/lib/typescript/module/avatar-group/types.d.ts +15 -1
  137. package/lib/typescript/module/avatar-group/types.d.ts.map +1 -1
  138. package/lib/typescript/module/composition-bar/CompositionBar.d.ts +4 -0
  139. package/lib/typescript/module/composition-bar/CompositionBar.d.ts.map +1 -0
  140. package/lib/typescript/module/composition-bar/index.d.ts +3 -0
  141. package/lib/typescript/module/composition-bar/index.d.ts.map +1 -0
  142. package/lib/typescript/module/composition-bar/types.d.ts +29 -0
  143. package/lib/typescript/module/composition-bar/types.d.ts.map +1 -0
  144. package/lib/typescript/module/dot-grid-meter/DotGridMeter.d.ts +4 -0
  145. package/lib/typescript/module/dot-grid-meter/DotGridMeter.d.ts.map +1 -0
  146. package/lib/typescript/module/dot-grid-meter/index.d.ts +3 -0
  147. package/lib/typescript/module/dot-grid-meter/index.d.ts.map +1 -0
  148. package/lib/typescript/module/dot-grid-meter/types.d.ts +36 -0
  149. package/lib/typescript/module/dot-grid-meter/types.d.ts.map +1 -0
  150. package/lib/typescript/module/index.d.ts +10 -0
  151. package/lib/typescript/module/index.d.ts.map +1 -1
  152. package/lib/typescript/module/index.web.d.ts +10 -0
  153. package/lib/typescript/module/index.web.d.ts.map +1 -1
  154. package/lib/typescript/module/profile-card/ProfileCard.d.ts +4 -0
  155. package/lib/typescript/module/profile-card/ProfileCard.d.ts.map +1 -0
  156. package/lib/typescript/module/profile-card/index.d.ts +3 -0
  157. package/lib/typescript/module/profile-card/index.d.ts.map +1 -0
  158. package/lib/typescript/module/profile-card/types.d.ts +86 -0
  159. package/lib/typescript/module/profile-card/types.d.ts.map +1 -0
  160. package/lib/typescript/module/stat-bar/StatBar.d.ts +4 -0
  161. package/lib/typescript/module/stat-bar/StatBar.d.ts.map +1 -0
  162. package/lib/typescript/module/stat-bar/index.d.ts +3 -0
  163. package/lib/typescript/module/stat-bar/index.d.ts.map +1 -0
  164. package/lib/typescript/module/stat-bar/types.d.ts +62 -0
  165. package/lib/typescript/module/stat-bar/types.d.ts.map +1 -0
  166. package/lib/typescript/module/typography/index.d.ts.map +1 -1
  167. package/lib/typescript/module/typography/styled-text.d.ts +1 -6
  168. package/lib/typescript/module/typography/styled-text.d.ts.map +1 -1
  169. package/package.json +56 -1
  170. package/src/__tests__/StatWidgets.test.tsx +184 -0
  171. package/src/__tests__/public-api-contract.test.ts +15 -0
  172. package/src/activity-heatmap/ActivityHeatmap.stories.tsx +108 -0
  173. package/src/activity-heatmap/ActivityHeatmap.tsx +289 -0
  174. package/src/activity-heatmap/bucketByDay.ts +49 -0
  175. package/src/activity-heatmap/index.ts +3 -0
  176. package/src/activity-heatmap/types.ts +74 -0
  177. package/src/avatar-group/AvatarGroup.stories.tsx +14 -0
  178. package/src/avatar-group/AvatarGroupBase.tsx +39 -18
  179. package/src/avatar-group/types.ts +15 -1
  180. package/src/composition-bar/CompositionBar.stories.tsx +70 -0
  181. package/src/composition-bar/CompositionBar.tsx +161 -0
  182. package/src/composition-bar/index.ts +2 -0
  183. package/src/composition-bar/types.ts +30 -0
  184. package/src/dot-grid-meter/DotGridMeter.stories.tsx +47 -0
  185. package/src/dot-grid-meter/DotGridMeter.tsx +71 -0
  186. package/src/dot-grid-meter/index.ts +2 -0
  187. package/src/dot-grid-meter/types.ts +36 -0
  188. package/src/index.ts +24 -0
  189. package/src/index.web.ts +24 -0
  190. package/src/profile-card/ProfileCard.stories.tsx +210 -0
  191. package/src/profile-card/ProfileCard.tsx +303 -0
  192. package/src/profile-card/index.ts +9 -0
  193. package/src/profile-card/types.ts +86 -0
  194. package/src/stat-bar/StatBar.stories.tsx +61 -0
  195. package/src/stat-bar/StatBar.tsx +156 -0
  196. package/src/stat-bar/index.ts +7 -0
  197. package/src/stat-bar/types.ts +65 -0
  198. package/src/typography/index.tsx +4 -6
  199. package/src/typography/styled-text.ts +11 -28
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StatBar = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _useTheme = require("../theme/use-theme.js");
10
+ var _index = require("../typography/index.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
+ function clampPercent(value) {
14
+ if (Number.isNaN(value)) return 0;
15
+ return Math.max(0, Math.min(100, value));
16
+ }
17
+
18
+ /**
19
+ * A horizontal labeled value bar with two variants:
20
+ *
21
+ * - `progress` — a rounded capsule track with a proportional `value / max`
22
+ * fill, an optional top-right `icon`, and an optional min/max footer row.
23
+ * - `split` — a capsule split at `percent` (left portion active, remainder the
24
+ * track color), a bold percentage right of the label, and a two-sided footer
25
+ * of opposing values (inflow/outflow style).
26
+ *
27
+ * Pure `<View>` composition, so it renders identically on web and native.
28
+ */
29
+ const StatBarComponent = props => {
30
+ const {
31
+ colors
32
+ } = (0, _useTheme.useTheme)();
33
+ const {
34
+ label,
35
+ fillColor,
36
+ trackColor,
37
+ height = 6,
38
+ icon,
39
+ style,
40
+ testID
41
+ } = props;
42
+ const fill = fillColor ?? colors.primary;
43
+ const track = trackColor ?? colors.backgroundSecondary;
44
+ const radius = height / 2;
45
+ if (props.variant === 'split') {
46
+ const {
47
+ percent,
48
+ leftValue,
49
+ rightValue,
50
+ leftColor,
51
+ rightColor
52
+ } = props;
53
+ const leftPercent = clampPercent(percent);
54
+ const activeLeft = leftColor ?? fill;
55
+ const remainder = rightColor ?? track;
56
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
57
+ style: [styles.wrap, style],
58
+ testID: testID,
59
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
60
+ style: styles.labelRow,
61
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
62
+ style: [styles.label, {
63
+ color: colors.textSecondary
64
+ }],
65
+ numberOfLines: 1,
66
+ children: label
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.Text, {
68
+ style: [styles.percent, {
69
+ color: colors.text
70
+ }],
71
+ numberOfLines: 1,
72
+ children: [Math.round(leftPercent), "%"]
73
+ })]
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
75
+ style: [styles.track, {
76
+ height,
77
+ borderRadius: radius,
78
+ backgroundColor: remainder
79
+ }],
80
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
81
+ style: {
82
+ width: `${leftPercent}%`,
83
+ height,
84
+ borderRadius: radius,
85
+ backgroundColor: activeLeft
86
+ }
87
+ })
88
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
89
+ style: styles.footerRow,
90
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
91
+ style: [styles.footerValue, {
92
+ color: colors.textTertiary
93
+ }],
94
+ numberOfLines: 1,
95
+ children: leftValue
96
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
97
+ style: [styles.footerValue, {
98
+ color: colors.textTertiary
99
+ }],
100
+ numberOfLines: 1,
101
+ children: rightValue
102
+ })]
103
+ })]
104
+ });
105
+ }
106
+ const {
107
+ value,
108
+ max,
109
+ minLabel,
110
+ maxLabel
111
+ } = props;
112
+ const ratio = max > 0 ? clampPercent(value / max * 100) : 0;
113
+ const hasFooter = minLabel != null || maxLabel != null;
114
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
115
+ style: [styles.wrap, style],
116
+ testID: testID,
117
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
118
+ style: styles.labelRow,
119
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
120
+ style: [styles.label, {
121
+ color: colors.textSecondary
122
+ }],
123
+ numberOfLines: 1,
124
+ children: label
125
+ }), icon != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
126
+ style: styles.icon,
127
+ children: icon
128
+ })]
129
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
130
+ style: [styles.track, {
131
+ height,
132
+ borderRadius: radius,
133
+ backgroundColor: track
134
+ }],
135
+ accessibilityRole: "progressbar",
136
+ accessibilityValue: {
137
+ min: 0,
138
+ max,
139
+ now: value
140
+ },
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
142
+ style: {
143
+ width: `${ratio}%`,
144
+ height,
145
+ borderRadius: radius,
146
+ backgroundColor: fill
147
+ }
148
+ })
149
+ }), hasFooter && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
150
+ style: styles.footerRow,
151
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
152
+ style: [styles.footerValue, {
153
+ color: colors.textTertiary
154
+ }],
155
+ numberOfLines: 1,
156
+ children: minLabel ?? ''
157
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Text, {
158
+ style: [styles.footerValue, {
159
+ color: colors.textTertiary
160
+ }],
161
+ numberOfLines: 1,
162
+ children: maxLabel ?? ''
163
+ })]
164
+ })]
165
+ });
166
+ };
167
+ const styles = _reactNative.StyleSheet.create({
168
+ wrap: {
169
+ gap: 8
170
+ },
171
+ labelRow: {
172
+ flexDirection: 'row',
173
+ alignItems: 'center',
174
+ justifyContent: 'space-between',
175
+ gap: 8
176
+ },
177
+ label: {
178
+ flexShrink: 1,
179
+ fontSize: 13,
180
+ fontWeight: '500'
181
+ },
182
+ percent: {
183
+ fontSize: 14,
184
+ fontWeight: '700',
185
+ letterSpacing: -0.2,
186
+ fontVariant: ['tabular-nums']
187
+ },
188
+ icon: {
189
+ marginLeft: 8
190
+ },
191
+ track: {
192
+ width: '100%',
193
+ overflow: 'hidden',
194
+ flexDirection: 'row',
195
+ borderCurve: 'continuous'
196
+ },
197
+ footerRow: {
198
+ flexDirection: 'row',
199
+ alignItems: 'center',
200
+ justifyContent: 'space-between',
201
+ gap: 8
202
+ },
203
+ footerValue: {
204
+ fontSize: 12,
205
+ fontVariant: ['tabular-nums']
206
+ }
207
+ });
208
+ const StatBar = exports.StatBar = /*#__PURE__*/(0, _react.memo)(StatBarComponent);
209
+ StatBar.displayName = 'StatBar';
210
+ //# sourceMappingURL=StatBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_index","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","clampPercent","value","Number","isNaN","Math","max","min","StatBarComponent","props","colors","useTheme","label","fillColor","trackColor","height","icon","style","testID","fill","primary","track","backgroundSecondary","radius","variant","percent","leftValue","rightValue","leftColor","rightColor","leftPercent","activeLeft","remainder","jsxs","View","styles","wrap","children","labelRow","jsx","Text","color","textSecondary","numberOfLines","text","round","borderRadius","backgroundColor","width","footerRow","footerValue","textTertiary","minLabel","maxLabel","ratio","hasFooter","accessibilityRole","accessibilityValue","now","StyleSheet","create","gap","flexDirection","alignItems","justifyContent","flexShrink","fontSize","fontWeight","letterSpacing","fontVariant","marginLeft","overflow","borderCurve","StatBar","exports","memo","displayName"],"sourceRoot":"../../../src","sources":["stat-bar/StatBar.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAqC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAA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AAC,cAAc;EAC9B;AACF,CAAC,CAAC;AAEK,MAAMI,OAAO,GAAAC,OAAA,CAAAD,OAAA,gBAAG,IAAAE,WAAI,EAACnE,gBAAgB,CAAC;AAC7CiE,OAAO,CAACG,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "StatBar", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _StatBar.StatBar;
10
+ }
11
+ });
12
+ var _StatBar = require("./StatBar.js");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_StatBar","require"],"sourceRoot":"../../../src","sources":["stat-bar/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["stat-bar/types.ts"],"mappings":"","ignoreList":[]}
@@ -65,14 +65,13 @@ const TextComponent = function Text({
65
65
  colors
66
66
  } = (0, _useTheme.useTheme)();
67
67
  const InteropText = (0, _styledText.getInteropText)();
68
- const interopActive = (0, _styledText.hasTypographyClassNameInterop)();
69
- const resolvedClassName = interopActive && className?.trim() ? className : undefined;
68
+ const trimmedClassName = className?.trim() ? className : undefined;
70
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(InteropText, {
71
70
  ...rest,
72
- ...(resolvedClassName ? {
73
- className: resolvedClassName
71
+ ...(trimmedClassName ? {
72
+ className: trimmedClassName
74
73
  } : {}),
75
- style: (0, _defaults.mergeTypographyStyle)(resolvedClassName, {
74
+ style: (0, _defaults.mergeTypographyStyle)(trimmedClassName, {
76
75
  ...DEFAULT_TEXT_TYPOGRAPHY,
77
76
  color: colors.text
78
77
  }, SANS_FONT_FAMILY, style),
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_tokens","_defaults","_styledText","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","fontFamilyStyle","kind","Platform","OS","fontFamily","SANS_FONT_FAMILY","DISPLAY_FONT_FAMILY","DEFAULT_TEXT_TYPOGRAPHY","fontSize","TextComponent","Text","children","style","className","rest","colors","useTheme","InteropText","getInteropText","interopActive","hasTypographyClassNameInterop","resolvedClassName","trim","undefined","jsx","mergeTypographyStyle","color","text","exports","Span","memo","displayName","HEADING_TYPOGRAPHY","fontWeight","createHeadingElement","level","HeadingElement","extraProps","role","headingBase","H1","H2","H3","H4","H5","H6","DEFAULT_PARAGRAPH_TYPOGRAPHY","lineHeight","P","paragraphDefaults","typographyDefaultsWhenNoClassName"],"sourceRoot":"../../../src","sources":["typography/index.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA8E,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,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C,KAAK;EAAEC,SAAS;EAAE,GAAGC;AAAgB,CAAC,EAAE;EAC1D,MAAMuB,UAAmC,GACvCnC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG;IAAEmC,IAAI,EAAE;EAAY,CAAC,GAAG,CAAC,CAAC;EACpD,MAAMW,iBAAiB,GAAG,IAAAC,2CAAiC,EACzDrC,SAAS,EACTiC,4BACF,CAAC;EACD,oBACE,IAAAlE,WAAA,CAAA4C,GAAA,EAACd,IAAI;IAAA,GACC2B,UAAU;IAAA,GACVvB,IAAI;IACRD,SAAS,EAAEA,SAAU;IACrBD,KAAK,EAAE,CAACqC,iBAAiB,EAAErC,KAAK;EAAE,CACnC,CAAC;AAEN;AACAoC,CAAC,CAACjB,WAAW,GAAG,GAAG","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_tokens","_defaults","_styledText","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","fontFamilyStyle","kind","Platform","OS","fontFamily","SANS_FONT_FAMILY","DISPLAY_FONT_FAMILY","DEFAULT_TEXT_TYPOGRAPHY","fontSize","TextComponent","Text","children","style","className","rest","colors","useTheme","InteropText","getInteropText","trimmedClassName","trim","undefined","jsx","mergeTypographyStyle","color","text","exports","Span","memo","displayName","HEADING_TYPOGRAPHY","fontWeight","createHeadingElement","level","HeadingElement","extraProps","role","headingBase","H1","H2","H3","H4","H5","H6","DEFAULT_PARAGRAPH_TYPOGRAPHY","lineHeight","P","paragraphDefaults","typographyDefaultsWhenNoClassName"],"sourceRoot":"../../../src","sources":["typography/index.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA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AC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDS,EAAE,CAACb,WAAW,GAAG,IAAI;AACd,MAAMc,EAAE,GAAAjB,OAAA,CAAAiB,EAAA,GAAGX,oBAAoB,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AACpDU,EAAE,CAACd,WAAW,GAAG,IAAI;AAErB,MAAMe,4BAAuC,GAAG;EAC9CpC,QAAQ,EAAE,EAAE;EACZqC,UAAU,EAAE,EAAE,GAAG;AACnB,CAAC;AAEM,SAASC,CAACA,CAAC;EAAElC,KAAK;EAAEC,SAAS;EAAE,GAAGC;AAAgB,CAAC,EAAE;EAC1D,MAAMqB,UAAmC,GACvCjC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG;IAAEiC,IAAI,EAAE;EAAY,CAAC,GAAG,CAAC,CAAC;EACpD,MAAMW,iBAAiB,GAAG,IAAAC,2CAAiC,EACzDnC,SAAS,EACT+B,4BACF,CAAC;EACD,oBACE,IAAAhE,WAAA,CAAA0C,GAAA,EAACZ,IAAI;IAAA,GACCyB,UAAU;IAAA,GACVrB,IAAI;IACRD,SAAS,EAAEA,SAAU;IACrBD,KAAK,EAAE,CAACmC,iBAAiB,EAAEnC,KAAK;EAAE,CACnC,CAAC;AAEN;AACAkC,CAAC,CAACjB,WAAW,GAAG,GAAG","ignoreList":[]}
@@ -6,31 +6,24 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getInteropText = getInteropText;
7
7
  exports.hasTypographyClassNameInterop = hasTypographyClassNameInterop;
8
8
  var _reactNative = require("react-native");
9
- var _lazyRequire = require("../utils/lazy-require.js");
10
- const getNativeWind = (0, _lazyRequire.lazyRequire)('nativewind');
11
- let interopText = _reactNative.Text;
12
-
9
+ var _reactNativeCss = require("react-native-css");
13
10
  /**
14
- * RN `Text` wired for NativeWind `className` → `style` interop when
15
- * `nativewind` is installed in the consumer. Falls back to plain `RNText`
16
- * otherwise (className is ignored upstream).
11
+ * RN `Text` wired for NativeWind `className` → `style` interop.
12
+ *
13
+ * Import `styled` from Bloom's direct dependency `react-native-css` — not via
14
+ * lazy `require('nativewind')`. Metro cannot reliably bundle dynamic requires
15
+ * from published `@oxyhq/bloom/lib`, so the 0.29.4 lazy path left interop
16
+ * inactive at runtime and Bloom defaults (fontSize 13) overrode hero utilities.
17
17
  */
18
+ const interopText = (0, _reactNativeCss.styled)(_reactNative.Text, {
19
+ className: 'style'
20
+ });
18
21
  function getInteropText() {
19
- if (interopText !== _reactNative.Text) {
20
- return interopText;
21
- }
22
- const nativewind = getNativeWind();
23
- if (nativewind?.styled) {
24
- interopText = nativewind.styled(_reactNative.Text, {
25
- className: 'style'
26
- });
27
- }
28
22
  return interopText;
29
23
  }
30
24
 
31
- /** True when className interop is active (nativewind present). */
25
+ /** True when className interop is active (always — react-native-css is a direct dep). */
32
26
  function hasTypographyClassNameInterop() {
33
- getInteropText();
34
- return interopText !== _reactNative.Text;
27
+ return true;
35
28
  }
36
29
  //# sourceMappingURL=styled-text.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_lazyRequire","getNativeWind","lazyRequire","interopText","RNText","getInteropText","nativewind","styled","className","hasTypographyClassNameInterop"],"sourceRoot":"../../../src","sources":["typography/styled-text.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAWA,MAAME,aAAa,GAAG,IAAAC,wBAAW,EAAmB,YAAY,CAAC;AAEjE,IAAIC,WAAgC,GAAGC,iBAAM;;AAE7C;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAA,EAAwB;EACpD,IAAIF,WAAW,KAAKC,iBAAM,EAAE;IAC1B,OAAOD,WAAW;EACpB;EAEA,MAAMG,UAAU,GAAGL,aAAa,CAAC,CAAC;EAClC,IAAIK,UAAU,EAAEC,MAAM,EAAE;IACtBJ,WAAW,GAAGG,UAAU,CAACC,MAAM,CAACH,iBAAM,EAAE;MAAEI,SAAS,EAAE;IAAQ,CAAC,CAAC;EACjE;EAEA,OAAOL,WAAW;AACpB;;AAEA;AACO,SAASM,6BAA6BA,CAAA,EAAY;EACvDJ,cAAc,CAAC,CAAC;EAChB,OAAOF,WAAW,KAAKC,iBAAM;AAC/B","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeCss","interopText","styled","RNText","className","getInteropText","hasTypographyClassNameInterop"],"sourceRoot":"../../../src","sources":["typography/styled-text.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,WAAgC,GAAG,IAAAC,sBAAM,EAACC,iBAAM,EAAE;EAAEC,SAAS,EAAE;AAAQ,CAAC,CAAC;AAExE,SAASC,cAAcA,CAAA,EAAwB;EACpD,OAAOJ,WAAW;AACpB;;AAEA;AACO,SAASK,6BAA6BA,CAAA,EAAY;EACvD,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+
3
+ import React, { memo, useMemo } from 'react';
4
+ import { View, Pressable, StyleSheet } from 'react-native';
5
+ import { useTheme } from "../theme/use-theme.js";
6
+ import { Text } from "../typography/index.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const DAY_MS = 86_400_000;
9
+ const DEFAULT_NUM_DAYS = 364;
10
+ const DEFAULT_LEVELS = [1, 3, 6, 10];
11
+ const DEFAULT_MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
12
+ /** Opacity steps (low→high) used to derive the default color scale from primary. */
13
+ const DEFAULT_ALPHAS = [0.16, 0.32, 0.52, 0.75, 1];
14
+ const LABEL_FONT_SIZE = 10;
15
+ const MONTH_ROW_HEIGHT = 16;
16
+ const WEEKDAY_COL_WIDTH = 26;
17
+ const DATE_KEY_RE = /^(\d{4})-(\d{2})-(\d{2})/;
18
+ function parseDateKey(key) {
19
+ const match = DATE_KEY_RE.exec(key);
20
+ if (match) {
21
+ const year = Number(match[1]);
22
+ const month = Number(match[2]);
23
+ const day = Number(match[3]);
24
+ const ts = Date.UTC(year, month - 1, day);
25
+ return Number.isNaN(ts) ? null : ts;
26
+ }
27
+ const parsed = Date.parse(key);
28
+ return Number.isNaN(parsed) ? null : parsed;
29
+ }
30
+ function formatUtcKey(ts) {
31
+ const d = new Date(ts);
32
+ const year = d.getUTCFullYear();
33
+ const month = String(d.getUTCMonth() + 1).padStart(2, '0');
34
+ const day = String(d.getUTCDate()).padStart(2, '0');
35
+ return `${year}-${month}-${day}`;
36
+ }
37
+
38
+ /** Count of ascending thresholds `count` meets — the color-scale index. */
39
+ function levelForCount(count, levels) {
40
+ if (count <= 0) return 0;
41
+ let level = 0;
42
+ for (const threshold of levels) {
43
+ if (count >= threshold) level += 1;else break;
44
+ }
45
+ return level;
46
+ }
47
+ function parseRgb(color) {
48
+ const trimmed = color.trim();
49
+ if (trimmed.startsWith('#')) {
50
+ let hex = trimmed.slice(1);
51
+ if (hex.length === 3) hex = hex.split('').map(c => c + c).join('');
52
+ if (hex.length !== 6) return null;
53
+ const r = parseInt(hex.slice(0, 2), 16);
54
+ const g = parseInt(hex.slice(2, 4), 16);
55
+ const b = parseInt(hex.slice(4, 6), 16);
56
+ if ([r, g, b].some(v => Number.isNaN(v))) return null;
57
+ return {
58
+ r,
59
+ g,
60
+ b
61
+ };
62
+ }
63
+ const match = /rgba?\(([^)]+)\)/i.exec(trimmed);
64
+ if (!match || match[1] === undefined) return null;
65
+ const parts = match[1].split(/[\s,/]+/).filter(Boolean).map(Number);
66
+ if (parts.length < 3) return null;
67
+ const [r, g, b] = parts;
68
+ if (r === undefined || g === undefined || b === undefined) return null;
69
+ if ([r, g, b].some(v => Number.isNaN(v))) return null;
70
+ return {
71
+ r,
72
+ g,
73
+ b
74
+ };
75
+ }
76
+
77
+ /** Compose `color` at `alpha`; returns the input unchanged if it can't parse. */
78
+ function withAlpha(color, alpha) {
79
+ const rgb = parseRgb(color);
80
+ if (!rgb) return color;
81
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`;
82
+ }
83
+ /**
84
+ * A GitHub-style contribution graph: columns of weeks × 7 weekday rows of
85
+ * rounded square cells, each colored by its day's activity level. Pure `<View>`
86
+ * composition (no SVG), rendering identically on web and native. The component
87
+ * lays out at its natural width — wrap it in a horizontal `ScrollView` for
88
+ * narrow viewports. All date math runs in UTC and the system clock is never
89
+ * read; anchor the grid with `endDate`.
90
+ */
91
+ const ActivityHeatmapComponent = ({
92
+ data,
93
+ numDays = DEFAULT_NUM_DAYS,
94
+ endDate,
95
+ levels = DEFAULT_LEVELS,
96
+ colorScale,
97
+ emptyColor,
98
+ cellSize = 12,
99
+ gap = 3,
100
+ weekStartsOn = 0,
101
+ monthLabels,
102
+ weekdayLabels,
103
+ onPressDay,
104
+ style,
105
+ testID
106
+ }) => {
107
+ const {
108
+ colors
109
+ } = useTheme();
110
+ const empty = emptyColor ?? colors.backgroundSecondary;
111
+ const scale = useMemo(() => colorScale ?? DEFAULT_ALPHAS.map(alpha => withAlpha(colors.primary, alpha)), [colorScale, colors.primary]);
112
+ const sortedLevels = useMemo(() => [...levels].sort((a, b) => a - b), [levels]);
113
+ const months = monthLabels ?? DEFAULT_MONTHS;
114
+ const grid = useMemo(() => {
115
+ // Sum counts per UTC day.
116
+ const countByKey = new Map();
117
+ let latest = null;
118
+ for (const entry of data) {
119
+ const ts = parseDateKey(entry.date);
120
+ if (ts === null) continue;
121
+ const key = formatUtcKey(ts);
122
+ countByKey.set(key, (countByKey.get(key) ?? 0) + entry.count);
123
+ if (latest === null || ts > latest) latest = ts;
124
+ }
125
+ const providedEnd = endDate ? parseDateKey(endDate) : null;
126
+ const endTs = providedEnd ?? latest;
127
+ if (endTs === null) return null;
128
+ const days = Math.max(1, Math.floor(numDays));
129
+ const rawStart = endTs - (days - 1) * DAY_MS;
130
+ // Align the first column to the start-of-week boundary.
131
+ const back = (new Date(rawStart).getUTCDay() - weekStartsOn + 7) % 7;
132
+ const gridStart = rawStart - back * DAY_MS;
133
+ const columnCount = Math.ceil((Math.floor((endTs - gridStart) / DAY_MS) + 1) / 7);
134
+ const maxColor = scale.length - 1;
135
+ const columns = [];
136
+ for (let c = 0; c < columnCount; c++) {
137
+ const column = [];
138
+ for (let r = 0; r < 7; r++) {
139
+ const ts = gridStart + (c * 7 + r) * DAY_MS;
140
+ if (ts > endTs) {
141
+ column.push(null);
142
+ continue;
143
+ }
144
+ const key = formatUtcKey(ts);
145
+ const count = countByKey.get(key) ?? 0;
146
+ const level = Math.min(levelForCount(count, sortedLevels), maxColor);
147
+ const color = count <= 0 ? empty : scale[level] ?? empty;
148
+ column.push({
149
+ key,
150
+ count,
151
+ color
152
+ });
153
+ }
154
+ columns.push(column);
155
+ }
156
+
157
+ // Month labels: first column whose leading day starts a new month.
158
+ const monthMarks = [];
159
+ let lastMonth = -1;
160
+ for (let c = 0; c < columnCount; c++) {
161
+ const firstTs = gridStart + c * 7 * DAY_MS;
162
+ const month = new Date(firstTs).getUTCMonth();
163
+ if (month !== lastMonth) {
164
+ monthMarks.push({
165
+ x: c * (cellSize + gap),
166
+ label: months[month] ?? DEFAULT_MONTHS[month] ?? ''
167
+ });
168
+ lastMonth = month;
169
+ }
170
+ }
171
+ return {
172
+ columns,
173
+ monthMarks
174
+ };
175
+ }, [data, endDate, numDays, weekStartsOn, sortedLevels, scale, empty, cellSize, gap, months]);
176
+ if (!grid) {
177
+ return /*#__PURE__*/_jsx(View, {
178
+ style: style,
179
+ testID: testID
180
+ });
181
+ }
182
+ const {
183
+ columns,
184
+ monthMarks
185
+ } = grid;
186
+ const hasWeekdayCol = Array.isArray(weekdayLabels);
187
+ const weekdayColWidth = hasWeekdayCol ? WEEKDAY_COL_WIDTH : 0;
188
+ const monthRowMarginLeft = hasWeekdayCol ? weekdayColWidth + gap : 0;
189
+ const cellRadius = Math.max(2, Math.round(cellSize * 0.25));
190
+ return /*#__PURE__*/_jsxs(View, {
191
+ style: style,
192
+ testID: testID,
193
+ children: [/*#__PURE__*/_jsx(View, {
194
+ style: [styles.monthRow, {
195
+ marginLeft: monthRowMarginLeft
196
+ }],
197
+ children: monthMarks.map((mark, i) => /*#__PURE__*/_jsx(Text, {
198
+ numberOfLines: 1,
199
+ style: [styles.label, {
200
+ left: mark.x,
201
+ color: colors.textTertiary
202
+ }],
203
+ children: mark.label
204
+ }, `${mark.label}-${i}`))
205
+ }), /*#__PURE__*/_jsxs(View, {
206
+ style: styles.body,
207
+ children: [hasWeekdayCol && /*#__PURE__*/_jsx(View, {
208
+ style: {
209
+ width: weekdayColWidth,
210
+ marginRight: gap
211
+ },
212
+ children: Array.from({
213
+ length: 7
214
+ }, (_, r) => {
215
+ const dow = (weekStartsOn + r) % 7;
216
+ return /*#__PURE__*/_jsx(View, {
217
+ style: {
218
+ height: cellSize,
219
+ marginBottom: r < 6 ? gap : 0,
220
+ justifyContent: 'center'
221
+ },
222
+ children: /*#__PURE__*/_jsx(Text, {
223
+ numberOfLines: 1,
224
+ style: [styles.weekdayLabel, {
225
+ color: colors.textTertiary
226
+ }],
227
+ children: weekdayLabels[dow] ?? ''
228
+ })
229
+ }, r);
230
+ })
231
+ }), /*#__PURE__*/_jsx(View, {
232
+ style: styles.grid,
233
+ children: columns.map((column, c) => /*#__PURE__*/_jsx(View, {
234
+ style: {
235
+ marginRight: c < columns.length - 1 ? gap : 0
236
+ },
237
+ children: column.map((cell, r) => {
238
+ const cellStyle = {
239
+ width: cellSize,
240
+ height: cellSize,
241
+ borderRadius: cellRadius,
242
+ marginBottom: r < 6 ? gap : 0
243
+ };
244
+ if (!cell) {
245
+ return /*#__PURE__*/_jsx(View, {
246
+ style: cellStyle
247
+ }, r);
248
+ }
249
+ if (onPressDay) {
250
+ const day = {
251
+ date: cell.key,
252
+ count: cell.count
253
+ };
254
+ return /*#__PURE__*/_jsx(Pressable, {
255
+ onPress: () => onPressDay(day),
256
+ accessibilityRole: "button",
257
+ accessibilityLabel: `${cell.key}: ${cell.count}`,
258
+ style: [cellStyle, styles.cell, {
259
+ backgroundColor: cell.color
260
+ }]
261
+ }, r);
262
+ }
263
+ return /*#__PURE__*/_jsx(View, {
264
+ style: [cellStyle, styles.cell, {
265
+ backgroundColor: cell.color
266
+ }]
267
+ }, r);
268
+ })
269
+ }, c))
270
+ })]
271
+ })]
272
+ });
273
+ };
274
+ const styles = StyleSheet.create({
275
+ monthRow: {
276
+ height: MONTH_ROW_HEIGHT,
277
+ position: 'relative'
278
+ },
279
+ label: {
280
+ position: 'absolute',
281
+ top: 0,
282
+ fontSize: LABEL_FONT_SIZE
283
+ },
284
+ body: {
285
+ flexDirection: 'row'
286
+ },
287
+ grid: {
288
+ flexDirection: 'row'
289
+ },
290
+ cell: {
291
+ borderCurve: 'continuous'
292
+ },
293
+ weekdayLabel: {
294
+ fontSize: LABEL_FONT_SIZE
295
+ }
296
+ });
297
+ export const ActivityHeatmap = /*#__PURE__*/memo(ActivityHeatmapComponent);
298
+ ActivityHeatmap.displayName = 'ActivityHeatmap';
299
+ //# sourceMappingURL=ActivityHeatmap.js.map