@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,258 @@
1
+ /**
2
+ * Type definitions for enhanced atoms with pairify function
3
+ * Provides comprehensive type safety for array-style syntax
4
+ */
5
+
6
+ import type { TextStyle, ViewStyle } from "react-native";
7
+ import type { BorderRadius, Colors, Spacing } from "./tokens";
8
+
9
+ // Base style value type
10
+ export type StyleValue = ViewStyle | TextStyle;
11
+
12
+ // Pairified structure types
13
+ export type PairifiedSpacing = {
14
+ [K in keyof Spacing]: StyleValue;
15
+ };
16
+
17
+ export type PairifiedColors = {
18
+ [K in keyof Colors]: K extends string
19
+ ? Colors[K] extends Record<string, any>
20
+ ? { [N in keyof Colors[K]]: StyleValue }
21
+ : StyleValue
22
+ : never;
23
+ };
24
+
25
+ export type PairifiedBorderRadius = {
26
+ [K in keyof BorderRadius]: StyleValue;
27
+ };
28
+
29
+ // Border utilities types
30
+ export type BorderWidthAtoms = {
31
+ thin: StyleValue;
32
+ medium: StyleValue;
33
+ thick: StyleValue;
34
+ };
35
+
36
+ export type BorderStyleAtoms = {
37
+ solid: StyleValue;
38
+ dashed: StyleValue;
39
+ dotted: StyleValue;
40
+ };
41
+
42
+ export type BorderSideAtoms = {
43
+ width: BorderWidthAtoms;
44
+ color: PairifiedColors;
45
+ };
46
+
47
+ export type BorderAtoms = {
48
+ width: BorderWidthAtoms;
49
+ style: BorderStyleAtoms;
50
+ color: PairifiedColors;
51
+ top: BorderSideAtoms;
52
+ bottom: BorderSideAtoms;
53
+ left: BorderSideAtoms;
54
+ right: BorderSideAtoms;
55
+ };
56
+
57
+ // Spacing atoms types
58
+ export type SpacingAtoms = {
59
+ margin: PairifiedSpacing;
60
+ marginTop: PairifiedSpacing;
61
+ marginRight: PairifiedSpacing;
62
+ marginBottom: PairifiedSpacing;
63
+ marginLeft: PairifiedSpacing;
64
+ marginHorizontal: PairifiedSpacing;
65
+ marginVertical: PairifiedSpacing;
66
+ padding: PairifiedSpacing;
67
+ paddingTop: PairifiedSpacing;
68
+ paddingRight: PairifiedSpacing;
69
+ paddingBottom: PairifiedSpacing;
70
+ paddingLeft: PairifiedSpacing;
71
+ paddingHorizontal: PairifiedSpacing;
72
+ paddingVertical: PairifiedSpacing;
73
+ };
74
+
75
+ // Border radius atoms types
76
+ export type RadiusAtoms = {
77
+ all: PairifiedBorderRadius;
78
+ top: PairifiedBorderRadius;
79
+ topRight: PairifiedBorderRadius;
80
+ bottom: PairifiedBorderRadius;
81
+ bottomRight: PairifiedBorderRadius;
82
+ left: PairifiedBorderRadius;
83
+ right: PairifiedBorderRadius;
84
+ };
85
+
86
+ export type PercentSizeValues = {
87
+ 10: StyleValue;
88
+ 20: StyleValue;
89
+ 25: StyleValue;
90
+ 30: StyleValue;
91
+ 33: StyleValue;
92
+ 40: StyleValue;
93
+ 50: StyleValue;
94
+ 60: StyleValue;
95
+ 66: StyleValue;
96
+ 70: StyleValue;
97
+ 75: StyleValue;
98
+ 80: StyleValue;
99
+ 90: StyleValue;
100
+ 100: StyleValue;
101
+ };
102
+
103
+ // Size utilities types
104
+ export type SizeAtoms = {
105
+ width: PairifiedSpacing & { percent: PercentSizeValues };
106
+ height: PairifiedSpacing & { percent: PercentSizeValues };
107
+ minWidth: PairifiedSpacing & { percent: PercentSizeValues };
108
+ minHeight: PairifiedSpacing & { percent: PercentSizeValues };
109
+ maxWidth: PairifiedSpacing & { percent: PercentSizeValues };
110
+ maxHeight: PairifiedSpacing & { percent: PercentSizeValues };
111
+ };
112
+
113
+ // Flex utilities types
114
+ export type FlexValues = {
115
+ 0: StyleValue;
116
+ 1: StyleValue;
117
+ 2: StyleValue;
118
+ 3: StyleValue;
119
+ 4: StyleValue;
120
+ 5: StyleValue;
121
+ };
122
+
123
+ export type FlexGrowShrinkValues = {
124
+ 0: StyleValue;
125
+ 1: StyleValue;
126
+ };
127
+
128
+ export type FlexAtoms = {
129
+ values: FlexValues;
130
+ grow: FlexGrowShrinkValues;
131
+ shrink: FlexGrowShrinkValues;
132
+ basis: PairifiedSpacing & PercentSizeValues & { auto: StyleValue };
133
+ };
134
+
135
+ // Opacity utilities types
136
+ export type OpacityAtoms = {
137
+ 0: StyleValue;
138
+ 5: StyleValue;
139
+ 10: StyleValue;
140
+ 20: StyleValue;
141
+ 25: StyleValue;
142
+ 30: StyleValue;
143
+ 40: StyleValue;
144
+ 50: StyleValue;
145
+ 60: StyleValue;
146
+ 70: StyleValue;
147
+ 75: StyleValue;
148
+ 80: StyleValue;
149
+ 90: StyleValue;
150
+ 95: StyleValue;
151
+ 100: StyleValue;
152
+ };
153
+
154
+ // Z-index utilities types
155
+ export type ZIndexAtoms = {
156
+ 0: StyleValue;
157
+ 10: StyleValue;
158
+ 20: StyleValue;
159
+ 30: StyleValue;
160
+ 40: StyleValue;
161
+ 50: StyleValue;
162
+ auto: StyleValue;
163
+ };
164
+
165
+ // Overflow utilities types
166
+ export type OverflowAtoms = {
167
+ visible: StyleValue;
168
+ hidden: StyleValue;
169
+ scroll: StyleValue;
170
+ };
171
+
172
+ // Text alignment utilities types
173
+ export type TextAlignAtoms = {
174
+ left: StyleValue;
175
+ center: StyleValue;
176
+ right: StyleValue;
177
+ justify: StyleValue;
178
+ auto: StyleValue;
179
+ };
180
+
181
+ // Font weight utilities types
182
+ export type FontWeightAtoms = {
183
+ thin: StyleValue;
184
+ extralight: StyleValue;
185
+ light: StyleValue;
186
+ normal: StyleValue;
187
+ medium: StyleValue;
188
+ semibold: StyleValue;
189
+ bold: StyleValue;
190
+ extrabold: StyleValue;
191
+ black: StyleValue;
192
+ };
193
+
194
+ // Layout utilities types
195
+ export type LayoutAtoms = {
196
+ flex: {
197
+ center: StyleValue;
198
+ row: StyleValue;
199
+ column: StyleValue;
200
+ spaceBetween: StyleValue;
201
+ spaceAround: StyleValue;
202
+ spaceEvenly: StyleValue;
203
+ };
204
+ position: {
205
+ absolute: StyleValue;
206
+ relative: StyleValue;
207
+ };
208
+ };
209
+
210
+ // Icon sizes types
211
+ export type IconSizeAtoms = {
212
+ sm: number;
213
+ md: number;
214
+ lg: number;
215
+ xl: number;
216
+ };
217
+
218
+ // Typography atoms types
219
+ export type TypographyAtoms = {
220
+ platform: Record<string, StyleValue>;
221
+ universal: Record<string, StyleValue>;
222
+ ios: Record<string, StyleValue>;
223
+ android: Record<string, StyleValue>;
224
+ };
225
+
226
+ // Main atoms object type
227
+ export type Atoms = {
228
+ colors: Colors;
229
+ spacing: typeof import("./tokens").spacing;
230
+ borderRadius: typeof import("./tokens").borderRadius;
231
+ radius: RadiusAtoms;
232
+ typography: TypographyAtoms;
233
+ shadows: typeof import("./tokens").shadows;
234
+ touchTargets: typeof import("./tokens").touchTargets;
235
+ animations: typeof import("./tokens").animations;
236
+ iconSizes: IconSizeAtoms;
237
+ layout: LayoutAtoms;
238
+ borders: BorderAtoms;
239
+ backgrounds: PairifiedColors;
240
+ textColors: PairifiedColors;
241
+ spacingAtoms: SpacingAtoms;
242
+ sizes: SizeAtoms;
243
+ flex: FlexAtoms;
244
+ opacity: OpacityAtoms;
245
+ zIndex: ZIndexAtoms;
246
+ overflow: OverflowAtoms;
247
+ textAlign: TextAlignAtoms;
248
+ fontWeight: FontWeightAtoms;
249
+ };
250
+
251
+ // Shorthand aliases types
252
+ export type BackgroundAtoms = PairifiedColors;
253
+ export type TextColorAtoms = PairifiedColors;
254
+ export type MarginAtoms = PairifiedSpacing;
255
+ export type PaddingAtoms = PairifiedSpacing;
256
+ export type WidthAtoms = PairifiedSpacing;
257
+ export type HeightAtoms = PairifiedSpacing;
258
+ export type BorderRadiusAllAtoms = PairifiedBorderRadius;
@@ -0,0 +1,48 @@
1
+ // Main theme system exports
2
+ export {
3
+ ThemeProvider,
4
+ createThemeColors,
5
+ createThemeIcons,
6
+ createThemeStyles,
7
+ createThemedStyles,
8
+ darkTheme,
9
+ lightTheme,
10
+ usePlatformTypography,
11
+ useTheme,
12
+ type Theme,
13
+ type ThemeIcons,
14
+ type ThemeStyles,
15
+ } from "./theme";
16
+
17
+ // Design tokens
18
+ export {
19
+ animations,
20
+ borderRadius,
21
+ breakpoints,
22
+ colors,
23
+ shadows,
24
+ spacing,
25
+ touchTargets,
26
+ typography,
27
+ type Animations,
28
+ type BorderRadius,
29
+ type Breakpoints,
30
+ type Colors,
31
+ type Shadows,
32
+ type Spacing,
33
+ type TouchTargets,
34
+ type Typography,
35
+ } from "./tokens";
36
+
37
+ // Utility atoms
38
+ export {
39
+ borders,
40
+ getPlatformTypography,
41
+ iconSizes,
42
+ layout,
43
+ typographyAtoms,
44
+ } from "./atoms";
45
+
46
+ // Convenience re-exports
47
+ export * as atoms from "./atoms";
48
+ export * as tokens from "./tokens";