Skip to content

Commit

Permalink
library: Add missing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Sep 30, 2024
1 parent 48917e4 commit 940303e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import top.yukonga.miuix.kmp.utils.createRipple
* @param title The title of the [BasicComponent].
* @param titleColor The color of the title.
* @param summary The summary of the [BasicComponent].
* @param summaryColor The color of the summary.
* @param leftAction The [Composable] content that on the left side of the [BasicComponent].
* @param rightActions The [Composable] content on the right side of the [BasicComponent].
* @param onClick The callback when the [BasicComponent] is clicked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fun SearchBar(
* @param enabled the enabled state of this input field. When `false`, this component will not
* respond to user input, and it will appear visually disabled and disabled to accessibility
* services.
* @param insideMargin the margin inside the [InputField].
* @param leadingIcon the leading icon to be displayed at the start of the input field.
* @param trailingIcon the trailing icon to be displayed at the end of the input field.
* @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
Expand All @@ -14,12 +15,14 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme
* A title component with Miuix style.
*
* @param text The text to be displayed in the title.
* @param textColor The color of the [SmallTitle].
* @param modifier The modifier to be applied to the [SmallTitle].
* @param insideMargin The margin inside the [SmallTitle].
*/
@Composable
fun SmallTitle(
text: String,
textColor: Color = MiuixTheme.colorScheme.onBackgroundVariant,
modifier: Modifier = Modifier,
insideMargin: DpSize = DpSize(28.dp, 8.dp),
) {
Expand All @@ -31,6 +34,6 @@ fun SmallTitle(
text = text,
fontSize = 14.sp,
fontWeight = FontWeight.Medium,
color = MiuixTheme.colorScheme.onBackgroundVariant
color = textColor
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme
* @param title The title of the [SuperArrow].
* @param titleColor The color of the title.
* @param summary The summary of the [SuperArrow].
* @param summaryColor The color of the summary.
* @param leftAction The [Composable] content that on the left side of the [SuperArrow].
* @param rightText The text on the right side of the [SuperArrow].
* @param onClick The callback when the [SuperArrow] is clicked.
Expand All @@ -38,6 +39,7 @@ fun SuperArrow(
title: String,
titleColor: Color = MiuixTheme.colorScheme.onSurface,
summary: String? = null,
summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary,
leftAction: @Composable (() -> Unit)? = null,
rightText: String? = null,
onClick: (() -> Unit)? = null,
Expand All @@ -50,6 +52,7 @@ fun SuperArrow(
title = title,
titleColor = titleColor,
summary = summary,
summaryColor = summaryColor,
leftAction = leftAction,
rightActions = { createRightActions(rightText) },
onClick = updatedOnClick
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme
* @param title The title of the [SuperCheckbox].
* @param titleColor The color of the title.
* @param summary The summary of the [SuperCheckbox].
* @param summaryColor The color of the summary.
* @param rightActions The [Composable] content that on the right side of the [SuperCheckbox].
* @param checked The checked state of the [SuperCheckbox].
* @param onCheckedChange The callback when the checked state of the [SuperCheckbox] is changed.
Expand All @@ -33,6 +34,7 @@ fun SuperCheckbox(
title: String,
titleColor: Color = MiuixTheme.colorScheme.onSurface,
summary: String? = null,
summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary,
rightActions: @Composable RowScope.() -> Unit = {},
checked: Boolean,
checkboxLocation: CheckboxLocation = CheckboxLocation.Left,
Expand All @@ -54,6 +56,7 @@ fun SuperCheckbox(
title = title,
titleColor = titleColor,
summary = summary,
summaryColor = summaryColor,
leftAction = if (checkboxLocation == CheckboxLocation.Left) {
{
Checkbox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import top.yukonga.miuix.kmp.utils.squircleshape.SquircleShape
* @param title The title of the [SuperDialog].
* @param titleColor The color of the title.
* @param summary The summary of the [SuperDialog].
* @param summaryColor The color of the summary.
* @param show The state of the [SuperDialog].
* @param onDismissRequest The callback when the [SuperDialog] is dismissed.
* @param insideMargin The margin inside the [SuperDialog].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ expect fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>
* @param title The title of the [SuperDropdown].
* @param titleColor The color of the title.
* @param summary The summary of the [SuperDropdown].
* @param summaryColor The color of the summary.
* @param modifier The modifier to be applied to the [SuperDropdown].
* @param items The options of the [SuperDropdown].
* @param alwaysRight Whether the popup is always show on the right side.
Expand All @@ -90,6 +91,7 @@ fun SuperDropdown(
title: String,
titleColor: Color = MiuixTheme.colorScheme.onSurface,
summary: String? = null,
summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary,
modifier: Modifier = Modifier,
items: List<String>,
alwaysRight: Boolean = false,
Expand Down Expand Up @@ -163,6 +165,7 @@ fun SuperDropdown(
title = title,
titleColor = titleColor,
summary = summary,
summaryColor = summaryColor,
rightActions = {
Text(
modifier = Modifier.padding(end = 6.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme
* @param title The title of the [SuperSwitch].
* @param titleColor The color of the title.
* @param summary The summary of the [SuperSwitch].
* @param summaryColor The color of the summary.
* @param leftAction The [Composable] content that on the left side of the [SuperSwitch].
* @param rightActions The [Composable] content on the right side of the [SuperSwitch].
* @param checked The checked state of the [SuperSwitch].
Expand All @@ -34,6 +35,7 @@ fun SuperSwitch(
title: String,
titleColor: Color = MiuixTheme.colorScheme.onSurface,
summary: String? = null,
summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary,
leftAction: @Composable (() -> Unit)? = null,
rightActions: @Composable RowScope.() -> Unit = {},
checked: Boolean,
Expand All @@ -55,6 +57,7 @@ fun SuperSwitch(
title = title,
titleColor = titleColor,
summary = summary,
summaryColor = summaryColor,
leftAction = leftAction,
rightActions = {
rightActions()
Expand Down

0 comments on commit 940303e

Please sign in to comment.