@streamplace/components 0.0.1 → 0.7.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 (169) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +35 -0
  3. package/dist/components/chat/chat-box.js +109 -0
  4. package/dist/components/chat/chat-message.js +76 -0
  5. package/dist/components/chat/chat.js +56 -0
  6. package/dist/components/chat/mention-suggestions.js +39 -0
  7. package/dist/components/chat/mod-view.js +33 -0
  8. package/dist/components/mobile-player/fullscreen.js +69 -0
  9. package/dist/components/mobile-player/fullscreen.native.js +151 -0
  10. package/dist/components/mobile-player/player.js +103 -0
  11. package/dist/components/mobile-player/props.js +1 -0
  12. package/dist/components/mobile-player/shared.js +51 -0
  13. package/dist/components/mobile-player/ui/countdown.js +79 -0
  14. package/dist/components/mobile-player/ui/index.js +5 -0
  15. package/dist/components/mobile-player/ui/input.js +38 -0
  16. package/dist/components/mobile-player/ui/metrics.js +40 -0
  17. package/dist/components/mobile-player/ui/streamer-context-menu.js +4 -0
  18. package/dist/components/mobile-player/ui/viewer-context-menu.js +20 -0
  19. package/dist/components/mobile-player/use-webrtc.js +232 -0
  20. package/dist/components/mobile-player/video.js +375 -0
  21. package/dist/components/mobile-player/video.native.js +238 -0
  22. package/dist/components/mobile-player/webrtc-diagnostics.js +106 -0
  23. package/dist/components/mobile-player/webrtc-primitives.js +25 -0
  24. package/dist/components/mobile-player/webrtc-primitives.native.js +1 -0
  25. package/dist/components/ui/button.js +220 -0
  26. package/dist/components/ui/dialog.js +203 -0
  27. package/dist/components/ui/dropdown.js +148 -0
  28. package/dist/components/ui/icons.js +22 -0
  29. package/dist/components/ui/index.js +22 -0
  30. package/dist/components/ui/input.js +202 -0
  31. package/dist/components/ui/loader.js +7 -0
  32. package/dist/components/ui/primitives/button.js +121 -0
  33. package/dist/components/ui/primitives/input.js +202 -0
  34. package/dist/components/ui/primitives/modal.js +203 -0
  35. package/dist/components/ui/primitives/text.js +286 -0
  36. package/dist/components/ui/resizeable.js +101 -0
  37. package/dist/components/ui/text.js +175 -0
  38. package/dist/components/ui/textarea.js +17 -0
  39. package/dist/components/ui/toast.js +129 -0
  40. package/dist/components/ui/view.js +250 -0
  41. package/dist/hooks/index.js +9 -0
  42. package/dist/hooks/useAvatars.js +32 -0
  43. package/dist/hooks/useCameraToggle.js +9 -0
  44. package/dist/hooks/useKeyboard.js +33 -0
  45. package/dist/hooks/useKeyboardSlide.js +11 -0
  46. package/dist/hooks/useLivestreamInfo.js +62 -0
  47. package/dist/hooks/useOuterAndInnerDimensions.js +27 -0
  48. package/dist/hooks/usePlayerDimensions.js +19 -0
  49. package/dist/hooks/useSegmentTiming.js +62 -0
  50. package/dist/index.js +16 -0
  51. package/dist/lib/facet.js +88 -0
  52. package/dist/lib/theme/atoms.js +620 -0
  53. package/dist/lib/theme/atoms.types.js +5 -0
  54. package/dist/lib/theme/index.js +9 -0
  55. package/dist/lib/theme/theme.js +248 -0
  56. package/dist/lib/theme/tokens.js +383 -0
  57. package/dist/lib/utils.js +94 -0
  58. package/dist/livestream-provider/index.js +25 -0
  59. package/dist/livestream-provider/websocket.js +41 -0
  60. package/dist/livestream-store/chat.js +186 -0
  61. package/dist/livestream-store/context.js +2 -0
  62. package/dist/livestream-store/index.js +4 -0
  63. package/dist/livestream-store/livestream-state.js +1 -0
  64. package/dist/livestream-store/livestream-store.js +42 -0
  65. package/dist/livestream-store/stream-key.js +115 -0
  66. package/dist/livestream-store/websocket-consumer.js +55 -0
  67. package/dist/player-store/context.js +2 -0
  68. package/dist/player-store/index.js +6 -0
  69. package/dist/player-store/player-provider.js +52 -0
  70. package/dist/player-store/player-state.js +22 -0
  71. package/dist/player-store/player-store.js +159 -0
  72. package/dist/player-store/single-player-provider.js +109 -0
  73. package/dist/streamplace-provider/context.js +2 -0
  74. package/dist/streamplace-provider/index.js +16 -0
  75. package/dist/streamplace-provider/poller.js +46 -0
  76. package/dist/streamplace-provider/xrpc.js +0 -0
  77. package/dist/streamplace-store/block.js +23 -0
  78. package/dist/streamplace-store/index.js +3 -0
  79. package/dist/streamplace-store/stream.js +193 -0
  80. package/dist/streamplace-store/streamplace-store.js +37 -0
  81. package/dist/streamplace-store/user.js +47 -0
  82. package/dist/streamplace-store/xrpc.js +12 -0
  83. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
  84. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
  85. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/67b1eb60 +0 -0
  86. package/node-compile-cache/v22.15.0-x64-efe9a9df-0/7c275f90 +0 -0
  87. package/package.json +50 -8
  88. package/src/components/chat/chat-box.tsx +195 -0
  89. package/src/components/chat/chat-message.tsx +192 -0
  90. package/src/components/chat/chat.tsx +128 -0
  91. package/src/components/chat/mention-suggestions.tsx +71 -0
  92. package/src/components/chat/mod-view.tsx +118 -0
  93. package/src/components/mobile-player/fullscreen.native.tsx +193 -0
  94. package/src/components/mobile-player/fullscreen.tsx +79 -0
  95. package/src/components/mobile-player/player.tsx +134 -0
  96. package/src/components/mobile-player/props.tsx +11 -0
  97. package/src/components/mobile-player/shared.tsx +56 -0
  98. package/src/components/mobile-player/ui/countdown.tsx +119 -0
  99. package/src/components/mobile-player/ui/index.ts +5 -0
  100. package/src/components/mobile-player/ui/input.tsx +85 -0
  101. package/src/components/mobile-player/ui/metrics.tsx +69 -0
  102. package/src/components/mobile-player/ui/streamer-context-menu.tsx +3 -0
  103. package/src/components/mobile-player/ui/viewer-context-menu.tsx +70 -0
  104. package/src/components/mobile-player/use-webrtc.tsx +282 -0
  105. package/src/components/mobile-player/video.native.tsx +360 -0
  106. package/src/components/mobile-player/video.tsx +557 -0
  107. package/src/components/mobile-player/webrtc-diagnostics.tsx +149 -0
  108. package/src/components/mobile-player/webrtc-primitives.native.tsx +6 -0
  109. package/src/components/mobile-player/webrtc-primitives.tsx +33 -0
  110. package/src/components/ui/button.tsx +309 -0
  111. package/src/components/ui/dialog.tsx +376 -0
  112. package/src/components/ui/dropdown.tsx +399 -0
  113. package/src/components/ui/icons.tsx +50 -0
  114. package/src/components/ui/index.ts +33 -0
  115. package/src/components/ui/input.tsx +350 -0
  116. package/src/components/ui/loader.tsx +9 -0
  117. package/src/components/ui/primitives/button.tsx +292 -0
  118. package/src/components/ui/primitives/input.tsx +422 -0
  119. package/src/components/ui/primitives/modal.tsx +421 -0
  120. package/src/components/ui/primitives/text.tsx +499 -0
  121. package/src/components/ui/resizeable.tsx +169 -0
  122. package/src/components/ui/text.tsx +330 -0
  123. package/src/components/ui/textarea.tsx +34 -0
  124. package/src/components/ui/toast.tsx +203 -0
  125. package/src/components/ui/view.tsx +344 -0
  126. package/src/hooks/index.ts +9 -0
  127. package/src/hooks/useAvatars.tsx +44 -0
  128. package/src/hooks/useCameraToggle.ts +12 -0
  129. package/src/hooks/useKeyboard.tsx +41 -0
  130. package/src/hooks/useKeyboardSlide.ts +12 -0
  131. package/src/hooks/useLivestreamInfo.ts +67 -0
  132. package/src/hooks/useOuterAndInnerDimensions.tsx +32 -0
  133. package/src/hooks/usePlayerDimensions.ts +23 -0
  134. package/src/hooks/useSegmentTiming.tsx +88 -0
  135. package/src/index.tsx +27 -0
  136. package/src/lib/facet.ts +131 -0
  137. package/src/lib/theme/atoms.ts +760 -0
  138. package/src/lib/theme/atoms.types.ts +258 -0
  139. package/src/lib/theme/index.ts +48 -0
  140. package/src/lib/theme/theme.tsx +436 -0
  141. package/src/lib/theme/tokens.ts +409 -0
  142. package/src/lib/utils.ts +132 -0
  143. package/src/livestream-provider/index.tsx +48 -0
  144. package/src/livestream-provider/websocket.tsx +47 -0
  145. package/src/livestream-store/chat.tsx +261 -0
  146. package/src/livestream-store/context.tsx +10 -0
  147. package/src/livestream-store/index.tsx +4 -0
  148. package/src/livestream-store/livestream-state.tsx +21 -0
  149. package/src/livestream-store/livestream-store.tsx +59 -0
  150. package/src/livestream-store/stream-key.tsx +124 -0
  151. package/src/livestream-store/websocket-consumer.tsx +62 -0
  152. package/src/player-store/context.tsx +11 -0
  153. package/src/player-store/index.tsx +6 -0
  154. package/src/player-store/player-provider.tsx +89 -0
  155. package/src/player-store/player-state.tsx +187 -0
  156. package/src/player-store/player-store.tsx +239 -0
  157. package/src/player-store/single-player-provider.tsx +181 -0
  158. package/src/streamplace-provider/context.tsx +10 -0
  159. package/src/streamplace-provider/index.tsx +32 -0
  160. package/src/streamplace-provider/poller.tsx +55 -0
  161. package/src/streamplace-provider/xrpc.tsx +0 -0
  162. package/src/streamplace-store/block.tsx +29 -0
  163. package/src/streamplace-store/index.tsx +3 -0
  164. package/src/streamplace-store/stream.tsx +262 -0
  165. package/src/streamplace-store/streamplace-store.tsx +89 -0
  166. package/src/streamplace-store/user.tsx +57 -0
  167. package/src/streamplace-store/xrpc.tsx +15 -0
  168. package/tsconfig.json +9 -0
  169. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,620 @@
1
+ /**
2
+ * Theme atoms - Enhanced exports with pairify function for array-style syntax
3
+ * These provide direct access to static design tokens and support composition
4
+ */
5
+ import { Platform } from "react-native";
6
+ import { animations, borderRadius, colors as rawColors, shadows, spacing, touchTargets, typography, } from "./tokens";
7
+ /**
8
+ * Pairify function - converts nested objects into key-value pairs that return style objects
9
+ * This allows for array-style syntax like style={[a.borders.green[300], a.shadows.xl]}
10
+ */
11
+ function pairify(obj, styleKeyPrefix) {
12
+ const result = {};
13
+ for (const [key, value] of Object.entries(obj)) {
14
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
15
+ // For nested objects (like color scales), create another level
16
+ result[key] = {};
17
+ for (const [nestedKey, nestedValue] of Object.entries(value)) {
18
+ result[key][nestedKey] = { [styleKeyPrefix]: nestedValue };
19
+ }
20
+ }
21
+ else {
22
+ // For simple values, create the style object directly
23
+ result[key] = { [styleKeyPrefix]: value };
24
+ }
25
+ }
26
+ return result;
27
+ }
28
+ /**
29
+ * Create pairified style atoms for easy composition
30
+ */
31
+ // Re-export static design tokens that don't change with theme
32
+ export { animations, borderRadius, shadows, spacing, touchTargets };
33
+ // Export raw color tokens for advanced use cases
34
+ export const colors = rawColors;
35
+ // Platform-aware typography helper
36
+ export const getPlatformTypography = () => {
37
+ if (Platform.OS === "ios") {
38
+ return typography.ios;
39
+ }
40
+ else if (Platform.OS === "android") {
41
+ return typography.android;
42
+ }
43
+ return typography.universal;
44
+ };
45
+ // Export all typography scales
46
+ export const typographyAtoms = {
47
+ platform: getPlatformTypography(),
48
+ universal: typography.universal,
49
+ ios: typography.ios,
50
+ android: typography.android,
51
+ };
52
+ // Static icon sizes (colors are handled by theme)
53
+ export const iconSizes = {
54
+ sm: 16,
55
+ md: 20,
56
+ lg: 24,
57
+ xl: 32,
58
+ };
59
+ // Common layout utilities
60
+ export const layout = {
61
+ flex: {
62
+ center: {
63
+ justifyContent: "center",
64
+ alignItems: "center",
65
+ },
66
+ alignCenter: {
67
+ alignItems: "center",
68
+ },
69
+ justifyCenter: {
70
+ justifyContent: "center",
71
+ },
72
+ row: {
73
+ flexDirection: "row",
74
+ },
75
+ column: {
76
+ flexDirection: "column",
77
+ },
78
+ spaceBetween: {
79
+ justifyContent: "space-between",
80
+ },
81
+ spaceAround: {
82
+ justifyContent: "space-around",
83
+ },
84
+ spaceEvenly: {
85
+ justifyContent: "space-evenly",
86
+ },
87
+ },
88
+ position: {
89
+ absolute: {
90
+ position: "absolute",
91
+ },
92
+ relative: {
93
+ position: "relative",
94
+ },
95
+ },
96
+ };
97
+ // Enhanced border utilities with pairified colors and widths
98
+ export const borders = {
99
+ width: pairify({
100
+ thin: 1,
101
+ medium: 2,
102
+ thick: 4,
103
+ }, "borderWidth"),
104
+ style: {
105
+ solid: { borderStyle: "solid" },
106
+ dashed: { borderStyle: "dashed" },
107
+ dotted: { borderStyle: "dotted" },
108
+ },
109
+ // Pairified color borders
110
+ color: pairify(rawColors, "borderColor"),
111
+ // Top border utilities
112
+ top: {
113
+ width: pairify({
114
+ thin: 1,
115
+ medium: 2,
116
+ thick: 4,
117
+ }, "borderTopWidth"),
118
+ color: pairify(rawColors, "borderTopColor"),
119
+ },
120
+ // Bottom border utilities
121
+ bottom: {
122
+ width: pairify({
123
+ thin: 1,
124
+ medium: 2,
125
+ thick: 4,
126
+ }, "borderBottomWidth"),
127
+ color: pairify(rawColors, "borderBottomColor"),
128
+ },
129
+ // Left border utilities
130
+ left: {
131
+ width: pairify({
132
+ thin: 1,
133
+ medium: 2,
134
+ thick: 4,
135
+ }, "borderLeftWidth"),
136
+ color: pairify(rawColors, "borderLeftColor"),
137
+ },
138
+ // Right border utilities
139
+ right: {
140
+ width: pairify({
141
+ thin: 1,
142
+ medium: 2,
143
+ thick: 4,
144
+ }, "borderRightWidth"),
145
+ color: pairify(rawColors, "borderRightColor"),
146
+ },
147
+ };
148
+ // Pairified spacing utilities
149
+ export const spacingAtoms = {
150
+ margin: pairify(spacing, "margin"),
151
+ marginTop: pairify(spacing, "marginTop"),
152
+ marginRight: pairify(spacing, "marginRight"),
153
+ marginBottom: pairify(spacing, "marginBottom"),
154
+ marginLeft: pairify(spacing, "marginLeft"),
155
+ marginHorizontal: pairify(spacing, "marginHorizontal"),
156
+ marginVertical: pairify(spacing, "marginVertical"),
157
+ padding: pairify(spacing, "padding"),
158
+ paddingTop: pairify(spacing, "paddingTop"),
159
+ paddingRight: pairify(spacing, "paddingRight"),
160
+ paddingBottom: pairify(spacing, "paddingBottom"),
161
+ paddingLeft: pairify(spacing, "paddingLeft"),
162
+ paddingHorizontal: pairify(spacing, "paddingHorizontal"),
163
+ paddingVertical: pairify(spacing, "paddingVertical"),
164
+ };
165
+ // Pairified border radius utilities
166
+ export const radiusAtoms = {
167
+ all: pairify(borderRadius, "borderRadius"),
168
+ top: pairify(borderRadius, "borderTopLeftRadius"),
169
+ topRight: pairify(borderRadius, "borderTopRightRadius"),
170
+ bottom: pairify(borderRadius, "borderBottomLeftRadius"),
171
+ bottomRight: pairify(borderRadius, "borderBottomRightRadius"),
172
+ left: pairify(borderRadius, "borderTopLeftRadius"),
173
+ right: pairify(borderRadius, "borderTopRightRadius"),
174
+ };
175
+ // Background color utilities
176
+ export const backgrounds = pairify(rawColors, "backgroundColor");
177
+ // Text color utilities
178
+ export const textColors = pairify(rawColors, "color");
179
+ // Percentage-based sizes
180
+ const percentageSizes = {
181
+ "10": "10%",
182
+ "20": "20%",
183
+ "25": "25%",
184
+ "30": "30%",
185
+ "33": "33.333333%",
186
+ "40": "40%",
187
+ "50": "50%",
188
+ "60": "60%",
189
+ "66": "66.666667%",
190
+ "70": "70%",
191
+ "75": "75%",
192
+ "80": "80%",
193
+ "90": "90%",
194
+ "100": "100%",
195
+ };
196
+ // Size utilities (width and height)
197
+ export const sizes = {
198
+ width: {
199
+ ...pairify(spacing, "width"),
200
+ percent: pairify(percentageSizes, "width"),
201
+ },
202
+ height: {
203
+ ...pairify(spacing, "height"),
204
+ percent: pairify(percentageSizes, "height"),
205
+ },
206
+ minWidth: {
207
+ ...pairify(spacing, "minWidth"),
208
+ percent: pairify(percentageSizes, "minWidth"),
209
+ },
210
+ minHeight: {
211
+ ...pairify(spacing, "minHeight"),
212
+ percent: pairify(percentageSizes, "minHeight"),
213
+ },
214
+ maxWidth: {
215
+ ...pairify(spacing, "maxWidth"),
216
+ percent: pairify(percentageSizes, "maxWidth"),
217
+ },
218
+ maxHeight: {
219
+ ...pairify(spacing, "maxHeight"),
220
+ percent: pairify(percentageSizes, "maxHeight"),
221
+ },
222
+ };
223
+ // Flex utilities
224
+ export const flex = {
225
+ values: pairify({
226
+ 0: 0,
227
+ 1: 1,
228
+ 2: 2,
229
+ 3: 3,
230
+ 4: 4,
231
+ 5: 5,
232
+ }, "flex"),
233
+ grow: pairify({
234
+ 0: 0,
235
+ 1: 1,
236
+ }, "flexGrow"),
237
+ shrink: pairify({
238
+ 0: 0,
239
+ 1: 1,
240
+ }, "flexShrink"),
241
+ basis: {
242
+ ...pairify(spacing, "flexBasis"),
243
+ ...pairify(percentageSizes, "flexBasis"),
244
+ auto: { flexBasis: "auto" },
245
+ },
246
+ };
247
+ // Opacity utilities
248
+ export const opacity = pairify({
249
+ 0: 0,
250
+ 5: 0.05,
251
+ 10: 0.1,
252
+ 20: 0.2,
253
+ 25: 0.25,
254
+ 30: 0.3,
255
+ 40: 0.4,
256
+ 50: 0.5,
257
+ 60: 0.6,
258
+ 70: 0.7,
259
+ 75: 0.75,
260
+ 80: 0.8,
261
+ 90: 0.9,
262
+ 95: 0.95,
263
+ 100: 1,
264
+ }, "opacity");
265
+ // Z-index utilities
266
+ export const zIndex = pairify({
267
+ 0: 0,
268
+ 10: 10,
269
+ 20: 20,
270
+ 30: 30,
271
+ 40: 40,
272
+ 50: 50,
273
+ auto: "auto",
274
+ }, "zIndex");
275
+ // Overflow utilities
276
+ export const overflow = {
277
+ visible: { overflow: "visible" },
278
+ hidden: { overflow: "hidden" },
279
+ scroll: { overflow: "scroll" },
280
+ };
281
+ // Text alignment utilities
282
+ export const textAlign = {
283
+ left: { textAlign: "left" },
284
+ center: { textAlign: "center" },
285
+ right: { textAlign: "right" },
286
+ justify: { textAlign: "justify" },
287
+ auto: { textAlign: "auto" },
288
+ };
289
+ // Font weight utilities
290
+ export const fontWeight = pairify({
291
+ thin: "100",
292
+ extralight: "200",
293
+ light: "300",
294
+ normal: "400",
295
+ medium: "500",
296
+ semibold: "600",
297
+ bold: "700",
298
+ extrabold: "800",
299
+ black: "900",
300
+ }, "fontWeight");
301
+ // Font size utilities (separate from typography for quick access)
302
+ export const fontSize = pairify({
303
+ xs: 12,
304
+ sm: 14,
305
+ base: 16,
306
+ lg: 18,
307
+ xl: 20,
308
+ "2xl": 24,
309
+ "3xl": 30,
310
+ "4xl": 36,
311
+ "5xl": 48,
312
+ "6xl": 60,
313
+ "7xl": 72,
314
+ "8xl": 96,
315
+ "9xl": 128,
316
+ }, "fontSize");
317
+ // Line height utilities
318
+ export const lineHeight = pairify({
319
+ none: 1,
320
+ tight: 1.25,
321
+ snug: 1.375,
322
+ normal: 1.5,
323
+ relaxed: 1.625,
324
+ loose: 2,
325
+ 3: 12,
326
+ 4: 16,
327
+ 5: 20,
328
+ 6: 24,
329
+ 7: 28,
330
+ 8: 32,
331
+ 9: 36,
332
+ 10: 40,
333
+ }, "lineHeight");
334
+ // Letter spacing utilities
335
+ export const letterSpacing = pairify({
336
+ tighter: -0.5,
337
+ tight: -0.25,
338
+ normal: 0,
339
+ wide: 0.25,
340
+ wider: 0.5,
341
+ widest: 1,
342
+ }, "letterSpacing");
343
+ // Text transform utilities
344
+ export const textTransform = {
345
+ uppercase: { textTransform: "uppercase" },
346
+ lowercase: { textTransform: "lowercase" },
347
+ capitalize: { textTransform: "capitalize" },
348
+ none: { textTransform: "none" },
349
+ };
350
+ // Text decoration utilities
351
+ export const textDecoration = {
352
+ none: { textDecorationLine: "none" },
353
+ underline: { textDecorationLine: "underline" },
354
+ lineThrough: { textDecorationLine: "line-through" },
355
+ underlineLineThrough: {
356
+ textDecorationLine: "underline line-through",
357
+ },
358
+ };
359
+ // Text align vertical utilities (React Native specific)
360
+ export const textAlignVertical = {
361
+ auto: { textAlignVertical: "auto" },
362
+ top: { textAlignVertical: "top" },
363
+ bottom: { textAlignVertical: "bottom" },
364
+ center: { textAlignVertical: "center" },
365
+ };
366
+ // Transform utilities
367
+ export const transforms = {
368
+ rotate: pairify({
369
+ 0: 0,
370
+ 1: 1,
371
+ 2: 2,
372
+ 3: 3,
373
+ 6: 6,
374
+ 12: 12,
375
+ 45: 45,
376
+ 90: 90,
377
+ 180: 180,
378
+ 270: 270,
379
+ }, "rotate"),
380
+ scale: pairify({
381
+ 0: 0,
382
+ 50: 0.5,
383
+ 75: 0.75,
384
+ 90: 0.9,
385
+ 95: 0.95,
386
+ 100: 1,
387
+ 105: 1.05,
388
+ 110: 1.1,
389
+ 125: 1.25,
390
+ 150: 1.5,
391
+ 200: 2,
392
+ }, "scale"),
393
+ scaleX: pairify({
394
+ 0: 0,
395
+ 50: 0.5,
396
+ 75: 0.75,
397
+ 90: 0.9,
398
+ 95: 0.95,
399
+ 100: 1,
400
+ 105: 1.05,
401
+ 110: 1.1,
402
+ 125: 1.25,
403
+ 150: 1.5,
404
+ 200: 2,
405
+ }, "scaleX"),
406
+ scaleY: pairify({
407
+ 0: 0,
408
+ 50: 0.5,
409
+ 75: 0.75,
410
+ 90: 0.9,
411
+ 95: 0.95,
412
+ 100: 1,
413
+ 105: 1.05,
414
+ 110: 1.1,
415
+ 125: 1.25,
416
+ 150: 1.5,
417
+ 200: 2,
418
+ }, "scaleY"),
419
+ translateX: pairify(spacing, "translateX"),
420
+ translateY: pairify(spacing, "translateY"),
421
+ };
422
+ // Absolute positioning utilities
423
+ export const position = {
424
+ top: pairify(spacing, "top"),
425
+ right: pairify(spacing, "right"),
426
+ bottom: pairify(spacing, "bottom"),
427
+ left: pairify(spacing, "left"),
428
+ // Common position combinations
429
+ topLeft: (top, left) => ({
430
+ position: "absolute",
431
+ top,
432
+ left,
433
+ }),
434
+ topRight: (top, right) => ({
435
+ position: "absolute",
436
+ top,
437
+ right,
438
+ }),
439
+ bottomLeft: (bottom, left) => ({
440
+ position: "absolute",
441
+ bottom,
442
+ left,
443
+ }),
444
+ bottomRight: (bottom, right) => ({
445
+ position: "absolute",
446
+ bottom,
447
+ right,
448
+ }),
449
+ // Percentage-based positioning
450
+ percent: {
451
+ top: pairify({
452
+ 0: "0%",
453
+ 25: "25%",
454
+ 50: "50%",
455
+ 75: "75%",
456
+ 100: "100%",
457
+ }, "top"),
458
+ right: pairify({
459
+ 0: "0%",
460
+ 25: "25%",
461
+ 50: "50%",
462
+ 75: "75%",
463
+ 100: "100%",
464
+ }, "right"),
465
+ bottom: pairify({
466
+ 0: "0%",
467
+ 25: "25%",
468
+ 50: "50%",
469
+ 75: "75%",
470
+ 100: "100%",
471
+ }, "bottom"),
472
+ left: pairify({
473
+ 0: "0%",
474
+ 25: "25%",
475
+ 50: "50%",
476
+ 75: "75%",
477
+ 100: "100%",
478
+ }, "left"),
479
+ },
480
+ };
481
+ // Aspect ratio utilities (React Native 0.71+)
482
+ export const aspectRatio = pairify({
483
+ square: 1,
484
+ video: 16 / 9,
485
+ photo: 4 / 3,
486
+ portrait: 3 / 4,
487
+ wide: 21 / 9,
488
+ ultrawide: 32 / 9,
489
+ "1/1": 1,
490
+ "3/2": 3 / 2,
491
+ "4/3": 4 / 3,
492
+ "16/9": 16 / 9,
493
+ "21/9": 21 / 9,
494
+ }, "aspectRatio");
495
+ // Gap utilities (React Native 0.71+)
496
+ export const gap = {
497
+ row: pairify(spacing, "rowGap"),
498
+ column: pairify(spacing, "columnGap"),
499
+ all: pairify(spacing, "gap"),
500
+ };
501
+ // Common layout patterns
502
+ export const layouts = {
503
+ // Full screen
504
+ fullScreen: {
505
+ position: "absolute",
506
+ top: 0,
507
+ left: 0,
508
+ right: 0,
509
+ bottom: 0,
510
+ },
511
+ // Centered content
512
+ centered: {
513
+ flex: 1,
514
+ justifyContent: "center",
515
+ alignItems: "center",
516
+ },
517
+ // Centered modal/overlay
518
+ overlay: {
519
+ position: "absolute",
520
+ top: 0,
521
+ left: 0,
522
+ right: 0,
523
+ bottom: 0,
524
+ justifyContent: "center",
525
+ alignItems: "center",
526
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
527
+ },
528
+ // Safe area friendly
529
+ safeContainer: {
530
+ flex: 1,
531
+ paddingTop: Platform.OS === "ios" ? 44 : 0, // Status bar height
532
+ },
533
+ // Row with space between
534
+ spaceBetweenRow: {
535
+ flexDirection: "row",
536
+ justifyContent: "space-between",
537
+ alignItems: "center",
538
+ },
539
+ // Sticky header
540
+ stickyHeader: {
541
+ position: "absolute",
542
+ top: 0,
543
+ left: 0,
544
+ right: 0,
545
+ zIndex: 10,
546
+ },
547
+ // Bottom sheet style
548
+ bottomSheet: {
549
+ position: "absolute",
550
+ bottom: 0,
551
+ left: 0,
552
+ right: 0,
553
+ borderTopLeftRadius: 16,
554
+ borderTopRightRadius: 16,
555
+ },
556
+ };
557
+ // Export everything as a combined atoms object for convenience
558
+ export const atoms = {
559
+ colors: rawColors,
560
+ spacing,
561
+ borderRadius,
562
+ radius: radiusAtoms,
563
+ typography: typographyAtoms,
564
+ shadows,
565
+ touchTargets,
566
+ animations,
567
+ iconSizes,
568
+ layout,
569
+ borders,
570
+ backgrounds,
571
+ textColors,
572
+ spacingAtoms,
573
+ sizes,
574
+ flex,
575
+ opacity,
576
+ zIndex,
577
+ overflow,
578
+ textAlign,
579
+ fontWeight,
580
+ fontSize,
581
+ lineHeight,
582
+ letterSpacing,
583
+ textTransform,
584
+ textDecoration,
585
+ textAlignVertical,
586
+ transforms,
587
+ position,
588
+ aspectRatio,
589
+ gap,
590
+ layouts,
591
+ };
592
+ // Convenient shorthand aliases
593
+ export const a = atoms;
594
+ export const bg = backgrounds;
595
+ export const text = textColors;
596
+ export const m = spacingAtoms.margin;
597
+ export const mt = spacingAtoms.marginTop;
598
+ export const mr = spacingAtoms.marginRight;
599
+ export const mb = spacingAtoms.marginBottom;
600
+ export const ml = spacingAtoms.marginLeft;
601
+ export const mx = spacingAtoms.marginHorizontal;
602
+ export const my = spacingAtoms.marginVertical;
603
+ export const p = spacingAtoms.padding;
604
+ export const pt = spacingAtoms.paddingTop;
605
+ export const pr = spacingAtoms.paddingRight;
606
+ export const pb = spacingAtoms.paddingBottom;
607
+ export const pl = spacingAtoms.paddingLeft;
608
+ export const px = spacingAtoms.paddingHorizontal;
609
+ export const py = spacingAtoms.paddingVertical;
610
+ export const w = sizes.width;
611
+ export const h = sizes.height;
612
+ export const r = radiusAtoms.all;
613
+ export const top = position.top;
614
+ export const right = position.right;
615
+ export const bottom = position.bottom;
616
+ export const left = position.left;
617
+ export const rotate = transforms.rotate;
618
+ export const scale = transforms.scale;
619
+ export const translateX = transforms.translateX;
620
+ export const translateY = transforms.translateY;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Type definitions for enhanced atoms with pairify function
3
+ * Provides comprehensive type safety for array-style syntax
4
+ */
5
+ export {};
@@ -0,0 +1,9 @@
1
+ // Main theme system exports
2
+ export { ThemeProvider, createThemeColors, createThemeIcons, createThemeStyles, createThemedStyles, darkTheme, lightTheme, usePlatformTypography, useTheme, } from "./theme";
3
+ // Design tokens
4
+ export { animations, borderRadius, breakpoints, colors, shadows, spacing, touchTargets, typography, } from "./tokens";
5
+ // Utility atoms
6
+ export { borders, getPlatformTypography, iconSizes, layout, typographyAtoms, } from "./atoms";
7
+ // Convenience re-exports
8
+ export * as atoms from "./atoms";
9
+ export * as tokens from "./tokens";