Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions android/CHANGELOG.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
`kr.devslab:dds-android-tokens`, `kr.devslab:dds-compose`, 그리고 0.7.0부터 `kr.devslab:dds-compose-testing`은 한 버전을 쓰고, 웹 패키지와는
버전이 따로다(D-048). 릴리스는 `android-v<버전>` 태그로 낸다.

## 0.12.0 — 2026-11-19

**새 기능**

- **`DdsSocialSignIn(primaryLimit = …)`** — 화면에 바로 보일 로그인 수단 개수를 정한다. 나머지는 시트에 남는다. 기존
호출의 기본값은 그대로 3이고, 1보다 작은 값은 거부한다.

## 0.11.1 — 2026-11-18

**고침**
Expand Down
7 changes: 7 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
`kr.devslab:dds-android-tokens`, `kr.devslab:dds-compose` and (from 0.7.0) `kr.devslab:dds-compose-testing` share one version,
separate from the web packages (D-048). Releases are cut by an `android-v<version>` tag.

## 0.12.0 — 2026-11-19

**New**

- **`DdsSocialSignIn(primaryLimit = …)`** chooses how many methods show inline; the rest stay in the sheet. Three remains
the default for the existing overloads, and a limit below one is rejected.

## 0.11.1 — 2026-11-18

**Fixed**
Expand Down
2 changes: 1 addition & 1 deletion android/README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mavenLocal { content { includeGroup("kr.devslab") } }

## 소셜 로그인 선택 UI

`DdsSocialSignIn`은 앱이 연결한 제공자를 전달받아 순서대로 표시한다. 처음 세 수단은 화면에 표시하고 나머지는 ‘다른 로그인 방법’ 시트에서 고를 수 있다. 앱은 각 버튼의 현지화된 문구를 지정한다. DDS가 제공자 로고를 표시하며 `DdsSignInMethod.icon`으로 앱의 에셋을 지정할 수 있다. 인증을 시작할 때 `onSelect`에서 선택한 제공자 ID를 받는다.
`DdsSocialSignIn`은 앱이 연결한 제공자를 전달받아 순서대로 표시한다. 처음 세 수단은 화면에 표시하고 나머지는 ‘다른 로그인 방법’ 시트에서 고를 수 있다. 화면에 보일 개수를 바꾸려면 `primaryLimit`(1 이상)을 넘긴다. 앱은 각 버튼의 현지화된 문구를 지정한다. DDS가 제공자 로고를 표시하며 `DdsSignInMethod.icon`으로 앱의 에셋을 지정할 수 있다. 인증을 시작할 때 `onSelect`에서 선택한 제공자 ID를 받는다.

```kotlin
DdsSocialSignIn(
Expand Down
2 changes: 1 addition & 1 deletion android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mavenLocal { content { includeGroup("kr.devslab") } }

## Social sign-in options

Pass the app's supported methods to `DdsSocialSignIn` in display order. It shows the first three and offers the remaining methods in a sheet. Each method takes a localized label. DDS draws the bundled brand mark by default, and `DdsSignInMethod.icon` accepts app-provided artwork. `onSelect` provides the public provider ID through the selected `DdsSocialProvider`.
Pass the app's supported methods to `DdsSocialSignIn` in display order. It shows the first three and offers the remaining methods in a sheet. Pass `primaryLimit` to show a different number inline (it must be positive). Each method takes a localized label. DDS draws the bundled brand mark by default, and `DdsSignInMethod.icon` accepts app-provided artwork. `onSelect` provides the public provider ID through the selected `DdsSocialProvider`.

```kotlin
DdsSocialSignIn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ class ScreenReaderTest {
DdsSignInMethod(DdsSocialProvider.Google, "Google"),
DdsSignInMethod(DdsSocialProvider.Kakao, "Kakao"),
DdsSignInMethod(DdsSocialProvider.Line, "LINE"),
DdsSignInMethod(DdsSocialProvider.Microsoft, "Microsoft"),
DdsSignInMethod(DdsSocialProvider.Slack, "Slack", enabled = false),
),
onSelect = { attempts.add(it); pending = it },
primaryLimit = 4,
pending = pending,
customization = DdsSocialSignInCustomization(
expanded = expanded,
Expand All @@ -164,21 +166,21 @@ class ScreenReaderTest {
),
)
}
rule.onNodeWithText("Main: Kakao").assertExists()
rule.onNodeWithText("Additional: LINE").assertDoesNotExist()
rule.onNodeWithText("Main: LINE").assertExists()
rule.onNodeWithText("Additional: Microsoft").assertDoesNotExist()
rule.onNodeWithText("More methods").performClick()
rule.onNodeWithText("Additional: Slack").assertIsNotEnabled()
rule.onNodeWithText("Additional: LINE").performClick()
rule.onNodeWithText("Additional: Microsoft").performClick()
rule.onNodeWithText("Main: Naver").assertIsNotEnabled()
rule.onNodeWithText("More methods").assertIsNotEnabled()
rule.onNodeWithText("Additional: Signing in with LINE").performClick()
rule.onNodeWithText("Additional: Signing in with Microsoft").performClick()
rule.onNodeWithText("Close methods").performClick()
rule.onNodeWithText("Additional: Signing in with LINE").assertExists()
rule.onNodeWithText("Additional: Signing in with Microsoft").assertExists()
rule.runOnIdle {
assertEquals(listOf(DdsSocialProvider.Line), attempts)
assertEquals(listOf(DdsSocialProvider.Microsoft), attempts)
pending = null
}
rule.onNodeWithText("Additional: LINE").assertDoesNotExist()
rule.onNodeWithText("Additional: Microsoft").assertDoesNotExist()
}

// --- text field ---------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public class DdsSocialSignInCustomization(
public val sheet: (@Composable (buttonWidth: Dp, onDismiss: () -> Unit, content: @Composable () -> Unit) -> Unit)? = null,
)

private const val DefaultPrimarySignInLimit = 3

/**
* Shows the app's [methods] in order. The first three appear inline and the rest open in a sheet.
* An empty list shows nothing. The first entry for each provider wins if the list contains duplicates.
Expand All @@ -116,7 +118,7 @@ public fun DdsSocialSignIn(
closeLabel: String = stringResource(R.string.dds_auth_close_methods),
gutter: Dp = ddsFrame().width.gutter,
) {
SocialSignIn(methods, onSelect, modifier, pending, moreLabel, closeLabel, gutter, customization = null)
DdsSocialSignIn(methods, onSelect, DefaultPrimarySignInLimit, modifier, pending, moreLabel, closeLabel, gutter)
}

/** Uses [customization] to integrate application-specific sign-in controls and recovery content. */
Expand All @@ -131,25 +133,28 @@ public fun DdsSocialSignIn(
closeLabel: String = stringResource(R.string.dds_auth_close_methods),
gutter: Dp = ddsFrame().width.gutter,
) {
SocialSignIn(methods, onSelect, modifier, pending, moreLabel, closeLabel, gutter, customization)
DdsSocialSignIn(methods, onSelect, DefaultPrimarySignInLimit, modifier, pending, moreLabel, closeLabel, gutter, customization)
}

/** Shows up to [primaryLimit] methods inline and the remaining methods in a sheet. The limit must be positive. */
@Composable
private fun SocialSignIn(
public fun DdsSocialSignIn(
methods: List<DdsSignInMethod>,
onSelect: (DdsSocialProvider) -> Unit,
modifier: Modifier,
pending: DdsSocialProvider?,
moreLabel: String,
closeLabel: String,
gutter: Dp,
customization: DdsSocialSignInCustomization?,
primaryLimit: Int,
modifier: Modifier = Modifier,
pending: DdsSocialProvider? = null,
moreLabel: String = stringResource(R.string.dds_auth_more_methods),
closeLabel: String = stringResource(R.string.dds_auth_close_methods),
gutter: Dp = ddsFrame().width.gutter,
customization: DdsSocialSignInCustomization? = null,
) {
require(primaryLimit > 0) { "primaryLimit must be positive" }
if (methods.isEmpty()) return

val ordered = methods.distinctBy { it.provider }
val primary = ordered.take(3)
val additional = ordered.drop(3)
val primary = ordered.take(primaryLimit)
val additional = ordered.drop(primaryLimit)
BoxWithConstraints(
modifier.fillMaxWidth().padding(horizontal = gutter),
contentAlignment = Alignment.TopCenter,
Expand Down
Loading