Skip to content

Commit 99b15e6

Browse files
committed
library: add spinnerColors to SuperSpinner
1 parent 492f573 commit 99b15e6

File tree

11 files changed

+248
-83
lines changed

11 files changed

+248
-83
lines changed

docs/components/superbottomsheet.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ Scaffold {
4343

4444
### SuperBottomSheet Properties
4545

46-
| Property Name | Type | Description | Default Value | Required |
47-
| -------------------------- | ---------------------------------- | -------------------------------------------- | ------------------------------------------- | -------- |
48-
| show | MutableState\<Boolean> | State object to control bottom sheet visibility | - | Yes |
49-
| modifier | Modifier | Modifier applied to the bottom sheet | Modifier | No |
50-
| title | String? | Bottom sheet title | null | No |
51-
| leftAction | @Composable (() -> Unit?)? | Optional composable for left action (e.g., close button) | null | No |
52-
| rightAction | @Composable (() -> Unit?)? | Optional composable for right action (e.g., submit button) | null | No |
53-
| backgroundColor | Color | Bottom sheet background color | SuperBottomSheetDefaults.backgroundColor() | No |
54-
| enableWindowDim | Boolean | Whether to enable dimming layer | true | No |
55-
| cornerRadius | Dp | Corner radius of the top corners | SuperBottomSheetDefaults.cornerRadius | No |
56-
| sheetMaxWidth | Dp | Maximum width of the bottom sheet | SuperBottomSheetDefaults.sheetMaxWidth | No |
57-
| onDismissRequest | (() -> Unit)? | Callback when bottom sheet is dismissed | null | No |
58-
| outsideMargin | DpSize | Bottom sheet external margin | SuperBottomSheetDefaults.outsideMargin | No |
59-
| insideMargin | DpSize | Bottom sheet internal content margin | SuperBottomSheetDefaults.insideMargin | No |
60-
| defaultWindowInsetsPadding | Boolean | Whether to apply default window insets padding | true | No |
61-
| dragHandleColor | Color | Drag indicator color | SuperBottomSheetDefaults.dragHandleColor() | No |
62-
| allowDismiss | Boolean | Whether to allow dismissing the sheet via drag or back gesture | true | No |
63-
| content | @Composable () -> Unit | Bottom sheet content | - | Yes |
46+
| Property Name | Type | Description | Default Value | Required |
47+
| -------------------------- | -------------------------------- | -------------------------------------------- | ------------------------------------------- | -------- |
48+
| show | MutableState\<Boolean> | State object to control bottom sheet visibility | - | Yes |
49+
| modifier | Modifier | Modifier applied to the bottom sheet | Modifier | No |
50+
| title | String? | Bottom sheet title | null | No |
51+
| leftAction | @Composable (() -> Unit)? | Optional composable for left action (e.g., close button) | null | No |
52+
| rightAction | @Composable (() -> Unit)? | Optional composable for right action (e.g., submit button) | null | No |
53+
| backgroundColor | Color | Bottom sheet background color | SuperBottomSheetDefaults.backgroundColor() | No |
54+
| enableWindowDim | Boolean | Whether to enable dimming layer | true | No |
55+
| cornerRadius | Dp | Corner radius of the top corners | SuperBottomSheetDefaults.cornerRadius | No |
56+
| sheetMaxWidth | Dp | Maximum width of the bottom sheet | SuperBottomSheetDefaults.sheetMaxWidth | No |
57+
| onDismissRequest | (() -> Unit)? | Callback when bottom sheet is dismissed | null | No |
58+
| outsideMargin | DpSize | Bottom sheet external margin | SuperBottomSheetDefaults.outsideMargin | No |
59+
| insideMargin | DpSize | Bottom sheet internal content margin | SuperBottomSheetDefaults.insideMargin | No |
60+
| defaultWindowInsetsPadding | Boolean | Whether to apply default window insets padding | true | No |
61+
| dragHandleColor | Color | Drag indicator color | SuperBottomSheetDefaults.dragHandleColor() | No |
62+
| allowDismiss | Boolean | Whether to allow dismissing the sheet via drag or back gesture | true | No |
63+
| content | @Composable () -> Unit | Bottom sheet content | - | Yes |
6464

6565
### SuperBottomSheetDefaults Object
6666

docs/components/superdropdown.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ SuperDropdown(
8181
| summary | String? | Summary description of dropdown | null | No |
8282
| summaryColor | BasicComponentColors | Summary text color configuration | BasicComponentDefaults.summaryColor() | No |
8383
| dropdownColors | DropdownColors | Color configuration for dropdown | DropdownDefaults.dropdownColors() | No |
84+
| leftAction | @Composable (() -> Unit)? | Custom left content | null | No |
8485
| modifier | Modifier | Modifier applied to the component | Modifier | No |
8586
| insideMargin | PaddingValues | Internal content padding | BasicComponentDefaults.InsideMargin | No |
8687
| maxHeight | Dp? | Maximum height of dropdown menu | null | No |

docs/components/superspinner.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Scaffold {
142142
| titleColor | BasicComponentColors | Title text color config | BasicComponentDefaults.titleColor() | No |
143143
| summary | String? | Selector description | null | No |
144144
| summaryColor | BasicComponentColors | Summary text color config | BasicComponentDefaults.summaryColor() | No |
145+
| spinnerColors | SpinnerColors | Color configuration for spinner | SpinnerDefaults.spinnerColors() | No |
145146
| leftAction | @Composable (() -> Unit)? | Custom left content | null | No |
146147
| modifier | Modifier | Component modifier | Modifier | No |
147148
| insideMargin | PaddingValues | Internal content padding | BasicComponentDefaults.InsideMargin | No |
@@ -161,6 +162,7 @@ Scaffold {
161162
| titleColor | BasicComponentColors | Title text color config | BasicComponentDefaults.titleColor() | No |
162163
| summary | String? | Selector description | null | No |
163164
| summaryColor | BasicComponentColors | Summary text color config | BasicComponentDefaults.summaryColor() | No |
165+
| spinnerColors | SpinnerColors | Color configuration for spinner | SpinnerDefaults.spinnerColors() | No |
164166
| leftAction | @Composable (() -> Unit)? | Custom left content | null | No |
165167
| dialogButtonString | String | Dialog bottom button text | - | Yes |
166168
| popupModifier | Modifier | Dialog popup modifier | Modifier | No |
@@ -179,8 +181,49 @@ Scaffold {
179181
| title | String? | Option title |
180182
| summary | String? | Option description |
181183

184+
### SpinnerColors Properties
185+
186+
| Property Name | Type | Description |
187+
| ------------------------ | ----- | --------------------------------- |
188+
| contentColor | Color | Option title color |
189+
| summaryColor | Color | Option summary color |
190+
| containerColor | Color | Option background color |
191+
| selectedContentColor | Color | Selected item title color |
192+
| selectedSummaryColor | Color | Selected item summary color |
193+
| selectedContainerColor | Color | Selected item background color |
194+
| selectedIndicatorColor | Color | Selected check icon color |
195+
182196
## Advanced Usage
183197

198+
### Custom Colors
199+
200+
```kotlin
201+
var selectedIndex by remember { mutableStateOf(0) }
202+
val options = listOf(
203+
SpinnerEntry(title = "Red"),
204+
SpinnerEntry(title = "Green"),
205+
SpinnerEntry(title = "Blue")
206+
)
207+
208+
Scaffold {
209+
SuperSpinner(
210+
title = "Custom Colors",
211+
items = options,
212+
selectedIndex = selectedIndex,
213+
onSelectedIndexChange = { selectedIndex = it },
214+
spinnerColors = SpinnerDefaults.spinnerColors(
215+
contentColor = MiuixTheme.colorScheme.onSurface,
216+
summaryColor = MiuixTheme.colorScheme.onSurfaceVariantSummary,
217+
containerColor = MiuixTheme.colorScheme.surface,
218+
selectedContentColor = Color.Red,
219+
selectedSummaryColor = Color.Red,
220+
selectedContainerColor = Color.Red.copy(alpha = 0.12f),
221+
selectedIndicatorColor = Color.Red
222+
)
223+
)
224+
}
225+
```
226+
184227
### Custom Left Content
185228

186229
```kotlin

docs/zh_CN/components/superbottomsheet.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ Scaffold {
4444
### SuperBottomSheet 属性
4545

4646
| 属性名 | 类型 | 说明 | 默认值 | 是否必须 |
47-
| -------------------------- | ------------------------------- | ---------------------------- | ------------------------------------------- | -------- |
48-
| show | MutableState\<Boolean> | 控制底部抽屉显示状态的状态对象 | - ||
49-
| modifier | Modifier | 应用于底部抽屉的修饰符 | Modifier ||
50-
| title | String? | 底部抽屉的标题 | null ||
51-
| leftAction | @Composable (() -> Unit?)? | 可选的左侧操作按钮(例如关闭按钮) | null ||
52-
| rightAction | @Composable (() -> Unit?)? | 可选的右侧操作按钮(例如提交按钮) | null ||
53-
| backgroundColor | Color | 底部抽屉背景色 | SuperBottomSheetDefaults.backgroundColor() ||
54-
| enableWindowDim | Boolean | 是否启用遮罩层 | true ||
55-
| cornerRadius | Dp | 顶部圆角半径 | SuperBottomSheetDefaults.cornerRadius ||
56-
| sheetMaxWidth | Dp | 底部抽屉的最大宽度 | SuperBottomSheetDefaults.sheetMaxWidth ||
57-
| onDismissRequest | (() -> Unit)? | 底部抽屉关闭时的回调函数 | null ||
58-
| outsideMargin | DpSize | 底部抽屉外部边距 | SuperBottomSheetDefaults.outsideMargin ||
59-
| insideMargin | DpSize | 底部抽屉内部内容的边距 | SuperBottomSheetDefaults.insideMargin ||
60-
| defaultWindowInsetsPadding | Boolean | 是否应用默认窗口插入内边距 | true ||
61-
| dragHandleColor | Color | 拖拽指示器的颜色 | SuperBottomSheetDefaults.dragHandleColor() ||
62-
| allowDismiss | Boolean | 是否允许通过拖拽或返回手势关闭抽屉 | true ||
63-
| content | @Composable () -> Unit | 底部抽屉的内容 | - ||
47+
| -------------------------- | ----------------------------- | ---------------------------- | ------------------------------------------- | -------- |
48+
| show | MutableState\<Boolean> | 控制底部抽屉显示状态的状态对象 | - ||
49+
| modifier | Modifier | 应用于底部抽屉的修饰符 | Modifier ||
50+
| title | String? | 底部抽屉的标题 | null ||
51+
| leftAction | @Composable (() -> Unit)? | 可选的左侧操作按钮(例如关闭按钮) | null ||
52+
| rightAction | @Composable (() -> Unit)? | 可选的右侧操作按钮(例如提交按钮) | null ||
53+
| backgroundColor | Color | 底部抽屉背景色 | SuperBottomSheetDefaults.backgroundColor() ||
54+
| enableWindowDim | Boolean | 是否启用遮罩层 | true ||
55+
| cornerRadius | Dp | 顶部圆角半径 | SuperBottomSheetDefaults.cornerRadius ||
56+
| sheetMaxWidth | Dp | 底部抽屉的最大宽度 | SuperBottomSheetDefaults.sheetMaxWidth ||
57+
| onDismissRequest | (() -> Unit)? | 底部抽屉关闭时的回调函数 | null ||
58+
| outsideMargin | DpSize | 底部抽屉外部边距 | SuperBottomSheetDefaults.outsideMargin ||
59+
| insideMargin | DpSize | 底部抽屉内部内容的边距 | SuperBottomSheetDefaults.insideMargin ||
60+
| defaultWindowInsetsPadding | Boolean | 是否应用默认窗口插入内边距 | true ||
61+
| dragHandleColor | Color | 拖拽指示器的颜色 | SuperBottomSheetDefaults.dragHandleColor() ||
62+
| allowDismiss | Boolean | 是否允许通过拖拽或返回手势关闭抽屉 | true ||
63+
| content | @Composable () -> Unit | 底部抽屉的内容 | - ||
6464

6565
### SuperBottomSheetDefaults 对象
6666

docs/zh_CN/components/superdropdown.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ SuperDropdown(
8181
| summary | String? | 下拉菜单的摘要说明 | null ||
8282
| summaryColor | BasicComponentColors | 摘要文本的颜色配置 | BasicComponentDefaults.summaryColor() ||
8383
| dropdownColors | DropdownColors | 下拉菜单的颜色配置 | DropdownDefaults.dropdownColors() ||
84+
| leftAction | @Composable (() -> Unit)? | 左侧显示的自定义内容 | null ||
8485
| modifier | Modifier | 应用于组件的修饰符 | Modifier ||
8586
| insideMargin | PaddingValues | 组件内部内容的边距 | BasicComponentDefaults.InsideMargin ||
8687
| maxHeight | Dp? | 下拉菜单的最大高度 | null ||

0 commit comments

Comments
 (0)