Package-level declarations

JengaTextField, JengaTextArea (multi-line comments with an optional character counter) and JengaSelectField.

Types

Link copied to clipboard
Link copied to clipboard
class JengaTextFieldColors(val container: Color, val focusedContainer: Color, val disabledContainer: Color, val border: Color, val focusedBorder: Color, val disabledBorder: Color, val focusRing: Color, val text: Color, val disabledText: Color, val placeholder: Color, val icon: Color)

Resolved colors for a JengaTextField. Override via JengaTextFieldDefaults.colors.

Link copied to clipboard

Defaults and token mappings for JengaTextField.

Link copied to clipboard

Validation status of a JengaTextField, driving border and supporting-text color.

Link copied to clipboard
class JengaTextFieldStyle(val shape: Shape? = null, val minHeight: Dp? = null, val contentPadding: PaddingValues? = null, val multilineMinHeight: Dp? = null, val multilineContentPadding: PaddingValues? = null, val focusRingWidth: Dp? = null, val textStyle: TextStyle? = null, val colors: JengaTextFieldColors? = null)

Theme-wide style for every JengaTextField, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.textField. A null value keeps Jenga's default; arguments passed to a JengaTextField call still win.

Functions

Link copied to clipboard
fun JengaSelectField(value: String?, onClick: () -> Unit, modifier: Modifier = Modifier, label: String? = null, placeholder: String? = null, status: JengaTextFieldStatus = JengaTextFieldStatus.Default, supportingText: String? = null, enabled: Boolean = true, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit = { JengaIcon(JengaIcons.ChevronDown, contentDescription = null) }, shape: Shape = JengaTextFieldDefaults.shape, colors: JengaTextFieldColors = JengaTextFieldDefaults.colors(), textStyle: TextStyle = JengaTextFieldDefaults.textStyle, minHeight: Dp = JengaTextFieldDefaults.minHeight, contentPadding: PaddingValues = JengaTextFieldDefaults.contentPadding, focusRingWidth: Dp = JengaTheme.components.textField?.focusRingWidth ?: JengaTextFieldDefaults.FocusRingWidth)

A field that shows a chosen value and opens a picker when tapped, instead of taking typed text. It looks like a JengaTextField; pair it with a picker such as io.github.joelkanyi.jenga.component.feedback.JengaListSheet.

Link copied to clipboard
fun JengaTextArea(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, label: String? = null, placeholder: String? = null, status: JengaTextFieldStatus = JengaTextFieldStatus.Default, supportingText: String? = null, maxLength: Int? = null, enabled: Boolean = true, readOnly: Boolean = false, minLines: Int = JengaTextAreaDefaults.MinLines, maxLines: Int = JengaTextAreaDefaults.MaxLines, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, shape: Shape = JengaTextFieldDefaults.shape, colors: JengaTextFieldColors = JengaTextFieldDefaults.colors(), textStyle: TextStyle = JengaTextFieldDefaults.textStyle, contentPadding: PaddingValues = JengaTextFieldDefaults.contentPadding(singleLine = false), focusRingWidth: Dp = JengaTheme.components.textField?.focusRingWidth ?: JengaTextFieldDefaults.FocusRingWidth)

A multi-line text box for comments, notes, reasons and descriptions. It starts minLines tall, grows up to maxLines as the user types, then scrolls inside itself. Text and placeholder start at the top. The Enter key adds a new line unless keyboardOptions sets an IME action.

Link copied to clipboard
fun JengaTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, label: String? = null, placeholder: String? = null, status: JengaTextFieldStatus = JengaTextFieldStatus.Default, supportingText: String? = null, enabled: Boolean = true, readOnly: Boolean = false, singleLine: Boolean = true, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, visualTransformation: VisualTransformation = VisualTransformation.None, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default, shape: Shape = JengaTextFieldDefaults.shape, colors: JengaTextFieldColors = JengaTextFieldDefaults.colors(), textStyle: TextStyle = JengaTextFieldDefaults.textStyle, minHeight: Dp = JengaTextFieldDefaults.minHeight(singleLine), contentPadding: PaddingValues = JengaTextFieldDefaults.contentPadding(singleLine), focusRingWidth: Dp = JengaTheme.components.textField?.focusRingWidth ?: JengaTextFieldDefaults.FocusRingWidth)

A single- or multi-line text input.