-
Notifications
You must be signed in to change notification settings - Fork 0
feat: DesignSystem 초기 구성 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6127d1d
[BOOK-61] feat: Color 상수 추가
seoyoon513 c52bf60
[BOOK-61] feat: Font 추가 및 Typography 정의
seoyoon513 f2daaa2
[BOOK-61] feat: Spacing, Border, Radius 정의
seoyoon513 a6bf393
[BOOK-61] refactor: Radius 변수 네이밍 변경
seoyoon513 0d3f162
[BOOK-61] feat: Semantic color 값 설정
seoyoon513 c53958f
[BOOK-61] feat: TextStyle 기본 컬러값 설정
seoyoon513 ec50d1d
[BOOK-61] feat: ReedTheme 정의
seoyoon513 d8a242a
[BOOK-61] feat: Icon 추가
seoyoon513 c75a936
[BOOK-61] feat: ReedButton Component 구현
seoyoon513 73f9225
[BOOK-61] feat: ReedTopAppBar Component 구현
seoyoon513 1cea3ed
[BOOK-61] feat: CheckBox Component 구현
seoyoon513 ad472f7
[BOOK-61] chore: code style check success
seoyoon513 5a9647a
[BOOK-61] fix: 버튼 패키지 경로 수정
seoyoon513 dc5e229
Merge branch 'develop' into BOOK-61-feature/#13
seoyoon513 a1e543a
[BOOK-61] fix: ReedCloseTopAppBar 파라미터 오타 수정
seoyoon513 fe39f1b
[BOOK-61] fix: import 수정 (android.support -> androidx)
seoyoon513 aa9de70
[BOOK-61] refactor: CheckBox Preview 토글 로직 변경
seoyoon513 4581c71
[BOOK-61] refector: Preview 함수 접근 제어자 private으로 변경
seoyoon513 8e29b2f
[BOOK-61] feat: ReedBottomSheet Component 구현
seoyoon513 03eefb2
[BOOK-61] feat: ButtonColorStyle에 KAKAO 타입 추가 및 로그인 버튼 적용
seoyoon513 e2342e6
[BOOK-61] chore: BooketButton 삭제
seoyoon513 75e676f
[BOOK-61] chore: code style check success
seoyoon513 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
116 changes: 0 additions & 116 deletions
116
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/Button.kt
This file was deleted.
Oops, something went wrong.
144 changes: 144 additions & 0 deletions
144
.../src/main/kotlin/com/ninecraft/booket/core/designsystem/component/appbar/ReedTopAppBar.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| package com.ninecraft.booket.core.designsystem.component.appbar | ||
|
|
||
| import androidx.annotation.DrawableRes | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxHeight | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.width | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.IconButton | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.ninecraft.booket.core.designsystem.R | ||
| import com.ninecraft.booket.core.designsystem.theme.ReedTheme | ||
| import com.ninecraft.booket.core.designsystem.theme.White | ||
|
|
||
| @Composable | ||
| fun ReedTopAppBar( | ||
| modifier: Modifier = Modifier, | ||
| title: String = "", | ||
| @DrawableRes startIconRes: Int? = null, | ||
| startIconDescription: String = "", | ||
| startIconOnClick: () -> Unit = {}, | ||
| @DrawableRes endIconRes: Int? = null, | ||
| endIconDescription: String = "", | ||
| endIconOnClick: () -> Unit = {}, | ||
| ) { | ||
| Row( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .height(56.dp) | ||
| .background(color = White), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| horizontalArrangement = Arrangement.Start, | ||
| ) { | ||
| if (startIconRes != null) { | ||
| IconButton( | ||
| onClick = { startIconOnClick() }, | ||
| modifier = Modifier | ||
| .fillMaxHeight() | ||
| .width(72.dp), | ||
| ) { | ||
| Icon( | ||
| painter = painterResource(id = startIconRes), | ||
| contentDescription = startIconDescription, | ||
| ) | ||
| } | ||
| } else { | ||
| Spacer(modifier = Modifier.width(72.dp)) | ||
| } | ||
|
|
||
| Text( | ||
| text = title, | ||
| style = ReedTheme.typography.heading2SemiBold, | ||
| modifier = Modifier.weight(1f), | ||
| textAlign = TextAlign.Center, | ||
| ) | ||
|
|
||
| if (endIconRes != null) { | ||
| IconButton( | ||
| onClick = { endIconOnClick() }, | ||
| modifier = Modifier | ||
| .fillMaxHeight() | ||
| .width(72.dp), | ||
| ) { | ||
| Icon( | ||
| painter = painterResource(id = endIconRes), | ||
| contentDescription = endIconDescription, | ||
| ) | ||
| } | ||
| } else { | ||
| Spacer(modifier = Modifier.width(72.dp)) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun ReedBackTopAppBar( | ||
| modifier: Modifier = Modifier, | ||
| title: String = "", | ||
| onNavigateBack: () -> Unit = {}, | ||
| ) { | ||
| ReedTopAppBar( | ||
| modifier = modifier, | ||
| title = title, | ||
| startIconRes = R.drawable.ic_chevron_left, | ||
| startIconDescription = "Back", | ||
| startIconOnClick = onNavigateBack, | ||
| ) | ||
| } | ||
|
|
||
| @Composable | ||
| fun ReedCloseTopAppBar( | ||
| modifier: Modifier = Modifier, | ||
| title: String = "", | ||
| onClose: () -> Unit = {}, | ||
| ) { | ||
| ReedTopAppBar( | ||
| modifier = modifier, | ||
| title = title, | ||
| endIconRes = R.drawable.ic_close, | ||
| endIconDescription = "Close", | ||
| endIconOnClick = onClose, | ||
| ) | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun ReedTopAppBarPreview() { | ||
| ReedTheme { | ||
| ReedTopAppBar( | ||
| title = "title", | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun ReedBackTopAppBarPreview() { | ||
| ReedTheme { | ||
| ReedBackTopAppBar( | ||
| title = "title", | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun ReedCloseTopAppBarPreview() { | ||
| ReedTheme { | ||
| ReedCloseTopAppBar( | ||
| title = "title", | ||
| ) | ||
| } | ||
| } |
66 changes: 66 additions & 0 deletions
66
...in/kotlin/com/ninecraft/booket/core/designsystem/component/bottomsheet/ReedBottomSheet.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package com.ninecraft.booket.core.designsystem.component.bottomsheet | ||
|
|
||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.ExperimentalMaterial3Api | ||
| import androidx.compose.material3.ModalBottomSheet | ||
| import androidx.compose.material3.SheetState | ||
| import androidx.compose.material3.SheetValue | ||
| import androidx.compose.material3.rememberModalBottomSheetState | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.ninecraft.booket.core.designsystem.component.button.ReedButton | ||
| import com.ninecraft.booket.core.designsystem.component.button.ReedButtonColorStyle | ||
| import com.ninecraft.booket.core.designsystem.component.button.largeButtonStyle | ||
| import com.ninecraft.booket.core.designsystem.theme.ReedTheme | ||
| import com.ninecraft.booket.core.designsystem.theme.White | ||
|
|
||
| @OptIn(ExperimentalMaterial3Api::class) | ||
| @Composable | ||
| fun ReedBottomSheet( | ||
| onDismissRequest: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| sheetState: SheetState = rememberModalBottomSheetState(), | ||
| content: @Composable () -> Unit, | ||
| ) { | ||
| ModalBottomSheet( | ||
| onDismissRequest = onDismissRequest, | ||
| modifier = modifier, | ||
| sheetState = sheetState, | ||
| sheetGesturesEnabled = false, | ||
| shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp), | ||
| dragHandle = null, | ||
| containerColor = White, | ||
| ) { | ||
| content() | ||
| } | ||
| } | ||
|
|
||
| @OptIn(ExperimentalMaterial3Api::class) | ||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun ReedBottomSheetPreview() { | ||
| val sheetState = SheetState( | ||
| skipPartiallyExpanded = true, | ||
| initialValue = SheetValue.Expanded, | ||
| positionalThreshold = { 0f }, | ||
| velocityThreshold = { 0f }, | ||
| ) | ||
| ReedTheme { | ||
| ReedBottomSheet( | ||
| sheetState = sheetState, | ||
| onDismissRequest = {}, | ||
| ) { | ||
| ReedButton( | ||
| onClick = {}, | ||
| modifier = Modifier.padding(10.dp).fillMaxWidth(), | ||
| colorStyle = ReedButtonColorStyle.PRIMARY, | ||
| sizeStyle = largeButtonStyle, | ||
| text = "확인", | ||
| ) | ||
| } | ||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
...c/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ButtonColorStyle.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.ninecraft.booket.core.designsystem.component.button | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import com.ninecraft.booket.core.designsystem.theme.Kakao | ||
| import com.ninecraft.booket.core.designsystem.theme.ReedTheme | ||
|
|
||
| enum class ReedButtonColorStyle { | ||
| PRIMARY, SECONDARY, TERTIARY, KAKAO; | ||
|
|
||
| @Composable | ||
| fun containerColor(isPressed: Boolean) = when (this) { | ||
| PRIMARY -> if (isPressed) ReedTheme.colors.bgPrimaryPressed else ReedTheme.colors.bgPrimary | ||
| SECONDARY -> if (isPressed) ReedTheme.colors.bgSecondaryPressed else ReedTheme.colors.bgSecondary | ||
| TERTIARY -> if (isPressed) ReedTheme.colors.bgTertiaryPressed else ReedTheme.colors.bgTertiary | ||
| KAKAO -> Kakao | ||
| } | ||
|
|
||
| @Composable | ||
| fun contentColor() = when (this) { | ||
| PRIMARY -> ReedTheme.colors.contentInverse | ||
| SECONDARY -> ReedTheme.colors.contentPrimary | ||
| TERTIARY -> ReedTheme.colors.contentBrand | ||
| KAKAO -> ReedTheme.colors.contentPrimary | ||
| } | ||
|
|
||
| @Composable | ||
| fun disabledContainerColor() = ReedTheme.colors.bgDisabled | ||
|
|
||
| @Composable | ||
| fun disabledContentColor() = ReedTheme.colors.contentDisabled | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
KAKAO 스타일의 pressed 상태 처리를 확인해주세요.
KAKAO 스타일의 경우
isPressed상태에 관계없이 항상 동일한Kakao색상을 반환합니다. 사용자에게 적절한 시각적 피드백을 제공하기 위해 pressed 상태에 대한 별도 색상 처리가 필요할 수 있습니다.📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디자이너가 따로 pressed 컬러 정의를 안해줬어
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seoyoon513 이해했습니다! 디자이너가 KAKAO 스타일에 대해 pressed 상태 색상을 별도로 정의하지 않았다면, 현재 구현이 올바르네요. 디자인 시스템에서는 모든 인터랙션 상태에 대해 항상 별도의 시각적 피드백이 필요한 것은 아니죠.
현재 구현대로 KAKAO 스타일은 pressed 상태에서도 동일한 색상을 유지하는 것이 디자인 의도에 맞습니다.
🐰
╭─────╮
│ 알겠 │
│ 어요 │
╰─────╯
✏️ Learnings added
🧠 Learnings used