Skip to content

Commit 8a9043d

Browse files
committed
Introduce StreamDesign tokens in the Compose Video SDK
Replace the video token layer (StreamColors, StreamDimens, StreamTypography, StreamShapes) with the shared StreamDesign token system, vendored like the chat SDK does. Token source: the core and video namespaces of design-system-tokens after the namespace restructure (PR #66, commit 8ad91b47). The classes in theme/design are generated from that source; the JSON snapshot is kept locally in .figma-tokens and not versioned, as in chat: - StreamDesign.Colors: 60 public semantic tokens (accent, text, background, border, avatar, system) derived from the brand and chrome scales at construction, plus internal component tokens (button, badge, control, input, label, tab). default() and defaultDark() take the scales as parameters; ColorScale.from(brandColor) re-brands from one color. - StreamDesign.Typography: the design system text styles. - StreamPrimitiveColors and StreamTokens (internal): raw palette, spacing, radius, sizes, strokes, font primitives and component sizes. Video-only tokens (indicator and accept-call colors) are internal extensions in the theme package, so the design package can move to a shared module unchanged. VideoTheme: isInDarkMode selects the light or dark palette; the ripple derives from the colors; LocalContentColor is textPrimary because the new typography carries no color. The text style providers set the role colors explicitly. Usages across the SDK, the demo app and the tutorials are migrated. The SDK uses StreamTokens; the apps use literal values because StreamTokens is internal. Labels drawn over video overlays use textOnAccent (white in both modes) and the moderation warning takes its colors from the theme. GenericContainer.roundness is a CornerSize now. The unused textSizeResource helper is removed. Goldens are re-recorded once: the new palette applies immediately and light and dark now render differently. apiDump updated.
1 parent 46fcd01 commit 8a9043d

284 files changed

Lines changed: 2228 additions & 1520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo-app/src/main/kotlin/io/getstream/video/android/DeeplinkingActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ class DeeplinkingActivity : ComponentActivity() {
6666
Box(
6767
modifier = Modifier
6868
.fillMaxSize()
69-
.background(VideoTheme.colors.baseSheetPrimary),
69+
.background(VideoTheme.colors.backgroundCoreApp),
7070
) {
7171
CircularProgressIndicator(
7272
modifier = Modifier.align(Alignment.Center),
73-
color = VideoTheme.colors.brandPrimary,
73+
color = VideoTheme.colors.accentPrimary,
7474
)
7575
}
7676
}

demo-app/src/main/kotlin/io/getstream/video/android/DemoAudioCallContent.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import androidx.compose.runtime.getValue
2626
import androidx.compose.ui.Alignment
2727
import androidx.compose.ui.Modifier
2828
import androidx.compose.ui.platform.testTag
29+
import androidx.compose.ui.unit.dp
2930
import androidx.lifecycle.compose.collectAsStateWithLifecycle
3031
import io.getstream.video.android.compose.theme.VideoTheme
3132
import io.getstream.video.android.compose.ui.components.base.styling.StreamFixedSizeButtonStyle
@@ -54,7 +55,7 @@ fun DemoAudioCallContent(
5455
AudioOnlyCallControls(
5556
modifier = Modifier
5657
.align(Alignment.BottomCenter)
57-
.padding(bottom = VideoTheme.dimens.genericXxl),
58+
.padding(bottom = 44.dp),
5859
isMicrophoneEnabled = micEnabled,
5960
isSpeakerEnabled = isSpeakerEnabled,
6061
onCallAction = onCallAction,

demo-app/src/main/kotlin/io/getstream/video/android/DemoOutgoingCallContent.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import androidx.compose.ui.Alignment
2727
import androidx.compose.ui.Modifier
2828
import androidx.compose.ui.platform.testTag
2929
import androidx.compose.ui.unit.Dp
30+
import androidx.compose.ui.unit.dp
3031
import androidx.lifecycle.compose.collectAsStateWithLifecycle
3132
import io.getstream.video.android.compose.theme.VideoTheme
3233
import io.getstream.video.android.compose.ui.components.call.controls.actions.CancelCallAction
@@ -65,7 +66,7 @@ fun DemoOutgoingCallContent(
6566
OutgoingCallControls(
6667
modifier = Modifier
6768
.align(Alignment.BottomCenter)
68-
.padding(bottom = VideoTheme.dimens.genericXxl),
69+
.padding(bottom = 44.dp),
6970
isVideoType,
7071
isCameraEnabled,
7172
micEnabled,

demo-app/src/main/kotlin/io/getstream/video/android/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class MainActivity : ComponentActivity() {
9090
VideoTheme {
9191
AppNavHost(
9292
modifier = Modifier
93-
.background(VideoTheme.colors.baseSheetPrimary)
93+
.background(VideoTheme.colors.backgroundCoreApp)
9494
.systemBarsPadding(),
9595
startDestination = if (!isLoggedIn) {
9696
AppScreens.Login.routeWithArg(true) // Pass true for autoLogIn

demo-app/src/main/kotlin/io/getstream/video/android/tooling/ui/ExceptionTraceScreen.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal fun ExceptionTraceScreen(packageName: String, message: String) {
5858
modifier =
5959
Modifier
6060
.verticalScroll(scrollState)
61-
.background(VideoTheme.colors.baseSheetPrimary)
61+
.background(VideoTheme.colors.backgroundCoreApp)
6262
.padding(16.dp),
6363
) {
6464
val context: Context = LocalContext.current
@@ -75,7 +75,7 @@ internal fun ExceptionTraceScreen(packageName: String, message: String) {
7575
Text(
7676
modifier = Modifier.align(Alignment.CenterStart),
7777
text = stringResource(id = R.string.stream_video_tooling_exception_log),
78-
color = VideoTheme.colors.basePrimary,
78+
color = VideoTheme.colors.textPrimary,
7979
fontWeight = FontWeight.Bold,
8080
fontSize = 16.sp,
8181
)
@@ -90,7 +90,7 @@ internal fun ExceptionTraceScreen(packageName: String, message: String) {
9090
context.toast(R.string.stream_video_tooling_copy_into_clipboard)
9191
},
9292
imageVector = Icons.Filled.ContentCopy,
93-
tint = VideoTheme.colors.basePrimary,
93+
tint = VideoTheme.colors.textPrimary,
9494
contentDescription = null,
9595
)
9696
}
@@ -101,12 +101,12 @@ internal fun ExceptionTraceScreen(packageName: String, message: String) {
101101
modifier =
102102
Modifier
103103
.border(
104-
border = BorderStroke(2.dp, VideoTheme.colors.brandPrimary),
104+
border = BorderStroke(2.dp, VideoTheme.colors.accentPrimary),
105105
shape = RoundedCornerShape(6.dp),
106106
)
107107
.padding(12.dp),
108108
text = message,
109-
color = VideoTheme.colors.basePrimary,
109+
color = VideoTheme.colors.textPrimary,
110110
fontSize = 14.sp,
111111
)
112112
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/CallSettingsUi.kt

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,26 @@ private fun CallSettingsContent(
155155
Column(
156156
modifier = modifier
157157
.fillMaxSize()
158-
.background(VideoTheme.colors.baseSheetPrimary),
158+
.background(VideoTheme.colors.backgroundCoreApp),
159159
) {
160160
Row(
161161
modifier = Modifier
162162
.fillMaxWidth()
163-
.background(VideoTheme.colors.baseSheetSecondary)
163+
.background(VideoTheme.colors.backgroundCoreElevation1)
164164
.padding(horizontal = 16.dp, vertical = 14.dp),
165165
horizontalArrangement = Arrangement.SpaceBetween,
166166
verticalAlignment = Alignment.CenterVertically,
167167
) {
168168
Text(
169169
text = "Call Settings",
170-
style = VideoTheme.typography.subtitleM,
171-
color = VideoTheme.colors.basePrimary,
170+
style = VideoTheme.typography.headingSmall,
171+
color = VideoTheme.colors.textPrimary,
172172
)
173173

174174
Box(
175175
modifier = Modifier
176176
.background(
177-
color = VideoTheme.colors.baseSheetTertiary,
177+
color = VideoTheme.colors.backgroundCoreSurfaceDefault,
178178
shape = RoundedCornerShape(999.dp),
179179
)
180180
.clickable(onClick = onClose)
@@ -183,7 +183,7 @@ private fun CallSettingsContent(
183183
Icon(
184184
imageVector = Icons.Default.Close,
185185
contentDescription = "Close",
186-
tint = VideoTheme.colors.basePrimary,
186+
tint = VideoTheme.colors.textPrimary,
187187
)
188188
}
189189
}
@@ -193,8 +193,8 @@ private fun CallSettingsContent(
193193
text = "Call service config registry is not available yet. " +
194194
"Sign in / start the SDK first.",
195195
modifier = Modifier.padding(16.dp),
196-
style = VideoTheme.typography.bodyM,
197-
color = VideoTheme.colors.baseSecondary,
196+
style = VideoTheme.typography.bodyDefault,
197+
color = VideoTheme.colors.textSecondary,
198198
)
199199
return@Column
200200
}
@@ -233,27 +233,27 @@ private fun CallTypeConfigCard(
233233
modifier = Modifier
234234
.fillMaxWidth()
235235
.background(
236-
color = VideoTheme.colors.baseSheetSecondary,
236+
color = VideoTheme.colors.backgroundCoreElevation1,
237237
shape = RoundedCornerShape(16.dp),
238238
)
239239
.padding(16.dp),
240240
) {
241241
Text(
242242
text = item.label,
243-
style = VideoTheme.typography.labelL,
244-
color = VideoTheme.colors.basePrimary,
243+
style = VideoTheme.typography.headingLarge,
244+
color = VideoTheme.colors.textPrimary,
245245
)
246246
Text(
247247
text = "type: ${item.callType.name}",
248248
modifier = Modifier.padding(top = 2.dp),
249-
style = VideoTheme.typography.labelM,
250-
color = VideoTheme.colors.baseSecondary,
249+
style = VideoTheme.typography.bodyEmphasis,
250+
color = VideoTheme.colors.textSecondary,
251251
)
252252
Text(
253253
text = "service: ${item.config.serviceClass.simpleName}",
254254
modifier = Modifier.padding(top = 2.dp, bottom = 8.dp),
255-
style = VideoTheme.typography.labelM,
256-
color = VideoTheme.colors.baseSecondary,
255+
style = VideoTheme.typography.bodyEmphasis,
256+
color = VideoTheme.colors.textSecondary,
257257
)
258258

259259
ToggleRow(
@@ -270,8 +270,8 @@ private fun CallTypeConfigCard(
270270
Text(
271271
text = "Audio usage",
272272
modifier = Modifier.padding(top = 12.dp, bottom = 8.dp),
273-
style = VideoTheme.typography.bodyS,
274-
color = VideoTheme.colors.basePrimary,
273+
style = VideoTheme.typography.captionDefault,
274+
color = VideoTheme.colors.textPrimary,
275275
)
276276
AudioUsageSelector(
277277
selected = item.config.audioUsage,
@@ -295,17 +295,17 @@ private fun ToggleRow(
295295
) {
296296
Text(
297297
text = label,
298-
style = VideoTheme.typography.bodyS,
299-
color = VideoTheme.colors.basePrimary,
298+
style = VideoTheme.typography.captionDefault,
299+
color = VideoTheme.colors.textPrimary,
300300
)
301301
Switch(
302302
checked = checked,
303303
onCheckedChange = onCheckedChange,
304304
colors = SwitchDefaults.colors(
305-
checkedThumbColor = VideoTheme.colors.brandPrimary,
306-
checkedTrackColor = VideoTheme.colors.brandPrimary,
307-
uncheckedThumbColor = VideoTheme.colors.baseSecondary,
308-
uncheckedTrackColor = VideoTheme.colors.baseSheetTertiary,
305+
checkedThumbColor = VideoTheme.colors.accentPrimary,
306+
checkedTrackColor = VideoTheme.colors.accentPrimary,
307+
uncheckedThumbColor = VideoTheme.colors.textSecondary,
308+
uncheckedTrackColor = VideoTheme.colors.backgroundCoreSurfaceDefault,
309309
),
310310
)
311311
}
@@ -329,19 +329,19 @@ private fun AudioUsageSelector(
329329
modifier = Modifier
330330
.background(
331331
color = if (isSelected) {
332-
VideoTheme.colors.brandPrimary
332+
VideoTheme.colors.accentPrimary
333333
} else {
334-
VideoTheme.colors.baseSheetTertiary
334+
VideoTheme.colors.backgroundCoreSurfaceDefault
335335
},
336336
shape = RoundedCornerShape(999.dp),
337337
)
338338
.clickable { onSelected(option.value) }
339339
.padding(horizontal = 12.dp, vertical = 8.dp),
340-
style = VideoTheme.typography.bodyS,
340+
style = VideoTheme.typography.captionDefault,
341341
color = if (isSelected) {
342-
VideoTheme.colors.baseSheetPrimary
342+
VideoTheme.colors.backgroundCoreApp
343343
} else {
344-
VideoTheme.colors.basePrimary
344+
VideoTheme.colors.textPrimary
345345
},
346346
)
347347
}

demo-app/src/main/kotlin/io/getstream/video/android/ui/Dialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fun SingleButtonDialog(
5858
horizontalAlignment = Alignment.CenterHorizontally,
5959
) {
6060
Text(
61-
color = VideoTheme.colors.baseSheetPrimary,
61+
color = VideoTheme.colors.backgroundCoreApp,
6262
fontWeight = FontWeight.Bold,
6363
text = title,
6464
fontSize = 18.sp,

demo-app/src/main/kotlin/io/getstream/video/android/ui/LogFileUi.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ fun LogFilesScreen(
101101
Column(
102102
modifier = modifier
103103
.fillMaxSize()
104-
.background(VideoTheme.colors.baseSheetPrimary),
104+
.background(VideoTheme.colors.backgroundCoreApp),
105105
) {
106106
Row(
107107
modifier = Modifier
108108
.fillMaxWidth()
109-
.background(VideoTheme.colors.baseSheetSecondary)
109+
.background(VideoTheme.colors.backgroundCoreElevation1)
110110
.padding(horizontal = 16.dp, vertical = 14.dp),
111111
horizontalArrangement = Arrangement.SpaceBetween,
112112
verticalAlignment = Alignment.CenterVertically,
113113
) {
114114
Text(
115115
text = "Log Files",
116-
style = VideoTheme.typography.subtitleM,
117-
color = VideoTheme.colors.basePrimary,
116+
style = VideoTheme.typography.headingSmall,
117+
color = VideoTheme.colors.textPrimary,
118118
)
119119

120120
Row(
@@ -131,14 +131,14 @@ fun LogFilesScreen(
131131
reloadFiles()
132132
}
133133
},
134-
style = VideoTheme.typography.bodyS,
135-
color = VideoTheme.colors.brandPrimary,
134+
style = VideoTheme.typography.captionDefault,
135+
color = VideoTheme.colors.accentPrimary,
136136
)
137137

138138
Box(
139139
modifier = Modifier
140140
.background(
141-
color = VideoTheme.colors.baseSheetTertiary,
141+
color = VideoTheme.colors.backgroundCoreSurfaceDefault,
142142
shape = RoundedCornerShape(999.dp),
143143
)
144144
.clickable(onClick = onClose)
@@ -147,7 +147,7 @@ fun LogFilesScreen(
147147
Icon(
148148
imageVector = Icons.Default.Close,
149149
contentDescription = "Close",
150-
tint = VideoTheme.colors.basePrimary,
150+
tint = VideoTheme.colors.textPrimary,
151151
)
152152
}
153153
}
@@ -182,8 +182,8 @@ private fun LogFileRow(
182182
) {
183183
Text(
184184
text = item.file.name,
185-
style = VideoTheme.typography.labelL,
186-
color = VideoTheme.colors.basePrimary,
185+
style = VideoTheme.typography.headingLarge,
186+
color = VideoTheme.colors.textPrimary,
187187
)
188188

189189
Row(
@@ -200,8 +200,8 @@ private fun LogFileRow(
200200
Text(
201201
text = item.file.absolutePath,
202202
modifier = Modifier.padding(top = 10.dp),
203-
style = VideoTheme.typography.labelM,
204-
color = VideoTheme.colors.baseSecondary,
203+
style = VideoTheme.typography.bodyEmphasis,
204+
color = VideoTheme.colors.textSecondary,
205205
)
206206
}
207207
}
@@ -212,12 +212,12 @@ private fun LogMetaChip(text: String) {
212212
text = text,
213213
modifier = Modifier
214214
.background(
215-
color = VideoTheme.colors.baseSheetTertiary,
215+
color = VideoTheme.colors.backgroundCoreSurfaceDefault,
216216
shape = RoundedCornerShape(999.dp),
217217
)
218218
.padding(horizontal = 10.dp, vertical = 6.dp),
219-
style = VideoTheme.typography.bodyS,
220-
color = VideoTheme.colors.basePrimary,
219+
style = VideoTheme.typography.captionDefault,
220+
color = VideoTheme.colors.textPrimary,
221221
)
222222
}
223223

demo-app/src/main/kotlin/io/getstream/video/android/ui/call/AvailableDeviceMenu.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ fun AvailableDeviceMenu(
6666
Card(
6767
modifier = Modifier.width(140.dp),
6868
shape = RoundedCornerShape(12.dp),
69-
contentColor = VideoTheme.colors.basePrimary,
70-
backgroundColor = VideoTheme.colors.baseSheetPrimary,
69+
contentColor = VideoTheme.colors.textPrimary,
70+
backgroundColor = VideoTheme.colors.backgroundCoreApp,
7171
elevation = 6.dp,
7272
) {
7373
LazyColumn(
@@ -90,7 +90,7 @@ fun AvailableDeviceMenu(
9090
.show()
9191
},
9292
text = audioDevice.name,
93-
color = VideoTheme.colors.basePrimary,
93+
color = VideoTheme.colors.textPrimary,
9494
)
9595
}
9696
}

0 commit comments

Comments
 (0)