diff --git a/sdds-core/config-codec/build.gradle.kts b/sdds-core/config-codec/build.gradle.kts new file mode 100644 index 000000000..90d03ff31 --- /dev/null +++ b/sdds-core/config-codec/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("convention.kotlin-java-version-sync") + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.kotlin.serialization) +} + +dependencies { + implementation(libs.base.kotlin.serialization.json) + testImplementation(libs.base.test.unit.jUnit) + testImplementation(libs.base.test.unit.mockk) +} + +tasks.register("runConfigCodec") { + group = "application" + description = "Run Config Codec with parameters" + classpath = sourceSets.main.get().runtimeClasspath + mainClass.set("com.sdds.utils.config.codec.AppKt") + + args = listOf( + "/Users/21934234/data/plasma-android/sdds-core/config-codec/src/test/resources/text_field_common.json", + "/Users/21934234/data/plasma-android/sdds-core/config-codec/src/test/resources/text_field_native.json", + "encode" + ) +} diff --git a/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/App.kt b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/App.kt new file mode 100644 index 000000000..18680fcc0 --- /dev/null +++ b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/App.kt @@ -0,0 +1,51 @@ +package com.sdds.utils.config.codec + +import com.sdds.utils.config.codec.internal.CommonConfig +import com.sdds.utils.config.codec.internal.ConfigCodec +import com.sdds.utils.config.codec.internal.NativeConfig +import kotlinx.serialization.decodeFromString +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import java.io.File + +private val serializer = Json { + ignoreUnknownKeys = true +} + +fun main(args: Array) { + if (args.size != 3) { + println("Usage: ") + return + } + + val inputPath = args[0] + val outputPath = args[1] + val mode = args[2] + + val inputFile = File(inputPath) + val outputFile = File(outputPath) + + if (!inputFile.exists()) { + println("Input file does not exist: $inputPath") + return + } + + val inputJson = inputFile.readText() + + val outputJson = when (mode.lowercase()) { + "encode" -> ConfigCodec.encode(serializer.decodeFromString(inputJson)).let { + serializer.encodeToString(it) + } + "decode" -> ConfigCodec.decode(serializer.decodeFromString(inputJson)).let { + serializer.encodeToString(it) + } + else -> { + println("Invalid mode: $mode. Use 'encode' or 'decode'.") + return + } + } + + outputFile.parentFile.mkdirs() + outputFile.writeText(outputJson) + println("Operation '$mode' completed. Output written to $outputPath") +} diff --git a/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/CommonConfig.kt b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/CommonConfig.kt new file mode 100644 index 000000000..b628ad689 --- /dev/null +++ b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/CommonConfig.kt @@ -0,0 +1,44 @@ +package com.sdds.utils.config.codec.internal + +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonObject + +@Serializable +internal data class CommonConfig( + val rootVariationId: String = "", + val colorSchemeVariationId: String = "", + val invariants: JsonObject? = null, + val variations: List = emptyList(), + val defaults: Set = emptySet(), +) + +@Serializable +internal data class Variation( + val id: String, + val name: String, + val values: Set +) + +@Serializable +internal data class VariationValue( + val name: String, + val targets: Set? = null, + val props: JsonObject? = null, +) + +@Serializable +internal data class VariationValueTarget( + val properties: Set +) + +@Serializable +internal data class TargetInfo( + val id: String, + val value: String, +) + +@Serializable +internal data class DefaultVariationValue( + val id: String, + val value: String, +) \ No newline at end of file diff --git a/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/ConfigCodec.kt b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/ConfigCodec.kt new file mode 100644 index 000000000..325c51c3f --- /dev/null +++ b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/ConfigCodec.kt @@ -0,0 +1,204 @@ +package com.sdds.utils.config.codec.internal + +internal object ConfigCodec { + + fun encode(config: CommonConfig): NativeConfig { + val nativeConfig = NativeConfig(props = config.invariants) + + val viewVariationId = config.colorSchemeVariationId + val viewVariation = config.variations.findLast { it.id == viewVariationId } + val rootsViews = viewVariation?.values + ?.filter { it.targets == null } + ?.associate { it.name to NativeViewVariation(it.props) } + .orEmpty() + + val targetRegistry = config.variations.flatMap { prop -> + prop.values.map { value -> + TargetInfo(prop.id, value.name) + } + }.groupBy { it.id } + + val targetViewRegistry = viewVariation?.values + ?.filter { it.targets != null } + ?.flatMap { viewValue -> + viewValue.targets!!.map { target -> viewValue.copy(targets = setOf(target)) } + } + ?.groupBy { it.targets!!.first() } + ?.mapValues { entry -> + entry.value.associate { viewValue -> viewValue.name to NativeViewVariation(viewValue.props) } + } + ?.mapKeys { entry -> + entry.key.properties.joinToString(".") { it.value } + } + .orEmpty() + .also { println("target views $it") } + + val variations = config.variations + .filter { it.id != viewVariationId } + .flatMap { property -> + property.values + .flatMap { value -> + value.toNativeVariation( + property.id, + config.rootVariationId, + targetRegistry, + targetViewRegistry + ) + } + }.filter { it.props != null } + + + return nativeConfig.copy(view = rootsViews, variations = variations) + } + + fun decode(config: NativeConfig): CommonConfig { + val variationRegistry = config.variations.associateBy { it.id } + + val viewPropertyValues = config.view.map { (name, view) -> + VariationValue( + name = name, + props = view.props, + targets = null + ) + } + + val targetViews = config.variations + .flatMap { variation -> + variation.view.map { (name, view) -> + var targetId = "" + val targets = variation.id.split(".") + .map { id -> + TargetInfo( + id = variationRegistry["$targetId$id"]?.kind.orEmpty(), + value = id + ).also { + targetId = "$targetId$id." + } + } + .toSet() + .let { VariationValueTarget(it) } + VariationValue( + name = name, + props = view.props, + targets = setOf(targets) + ) + } + } + + val viewValues = (viewPropertyValues + targetViews).toSet() + val viewProperty = Variation( + id = NATIVE_VIEW_VARIATION_NAME, + name = NATIVE_VIEW_VARIATION_NAME, + values = viewValues + ) + .takeIf { viewValues.isNotEmpty() } + .let { listOfNotNull(it) } + .mergeConfigProperty() + + val variationPropertyValues = config.variations.map { variation -> + var targetId = "" + val targets = variation.id.split(".") + .dropLast(1) + .takeIf { it.isNotEmpty() } + ?.map { id -> + TargetInfo( + id = variationRegistry["$targetId$id"]?.kind.orEmpty(), + value = id + ).also { targetId = "$targetId$id." } + } + ?.toSet() + ?.let { setOf(VariationValueTarget(it)) } + + val value = VariationValue( + name = variation.id.removePrefix("${variation.parent}."), + props = variation.props, + targets = targets + ) + Variation( + id = variation.kind, + name = variation.kind, + values = setOf(value) + ) + }.mergeConfigProperty() + + return CommonConfig( + invariants = config.props, + variations = viewProperty + variationPropertyValues, + rootVariationId = NATIVE_SIZE_VARIATION_NAME, + colorSchemeVariationId = NATIVE_VIEW_VARIATION_NAME, + ) + } + private const val NATIVE_VIEW_VARIATION_NAME = "view" + private const val NATIVE_SIZE_VARIATION_NAME = "size" +} + +private fun VariationValue.toNativeVariation( + propertyId: String, + rootPropertyId: String, + targetRegistry: Map>, + targetViewRegistry: Map> = emptyMap(), +): List { + + if (targets != null) { + return targets.map { target -> + val parent = target.properties.joinToString(".") { it.value } + val id = "$parent.$name" + NativeVariation( + id = id, + kind = propertyId, + parent = parent, + props = props, + view = targetViewRegistry[id].orEmpty() + ) + } + } + return targetRegistry[rootPropertyId] + ?.takeIf { rootPropertyId != propertyId } + ?.map { info -> + val parent = info.value + val id = "$parent.$name" + NativeVariation( + id = id, + kind = propertyId, + parent = parent, + props = props, + view = targetViewRegistry[id].orEmpty() + ) + } + ?: listOf( + NativeVariation( + id = name, + kind = propertyId, + props = props, + view = targetViewRegistry[name].orEmpty() + ) + ) +} + +private fun List.mergeConfigProperty(): List { + return groupBy { it.id }.map { (id, group) -> + val name = group.first().name + + val mergedValues = group.flatMap { it.values } + .groupBy { it.name to it.props } + .map { (key, valuesGroup) -> + val mergedTargets = valuesGroup + .mapNotNull { it.targets } + .flatten() + .toSet() + .takeIf { it.isNotEmpty() } + + VariationValue( + name = key.first, + props = key.second, + targets = mergedTargets + ) + }.toSet() + + Variation( + id = id, + name = name, + values = mergedValues + ) + } +} \ No newline at end of file diff --git a/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/NativeConfig.kt b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/NativeConfig.kt new file mode 100644 index 000000000..b6a0fc5e0 --- /dev/null +++ b/sdds-core/config-codec/src/main/kotlin/com/sdds/utils/config/codec/internal/NativeConfig.kt @@ -0,0 +1,25 @@ +package com.sdds.utils.config.codec.internal + +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonObject + +@Serializable +internal data class NativeConfig( + var view: Map = emptyMap(), + var props: JsonObject? = null, + var variations: List = emptyList() +) + +@Serializable +internal data class NativeViewVariation( + val props: JsonObject? +) + +@Serializable +internal data class NativeVariation( + val id: String, + val kind: String, + val parent: String? = null, + val view: Map = emptyMap(), + val props: JsonObject? = null +) \ No newline at end of file diff --git a/sdds-core/config-codec/src/test/resources/icon_button_common.json b/sdds-core/config-codec/src/test/resources/icon_button_common.json new file mode 100644 index 000000000..6a1ab642a --- /dev/null +++ b/sdds-core/config-codec/src/test/resources/icon_button_common.json @@ -0,0 +1,402 @@ +{ + "rootPropertyId": "size", + "commonValues": { + "loadingAlpha": { + "type": "float", + "value": 0 + }, + "disableAlpha": { + "type": "float", + "value": 0.4 + } + }, + "defaults": [ + { "id": "size", "value": "m" }, + { "id": "view", "value": "default" } + ], + "properties": [ + { + "id": "size", + "name": "size", + "values": [ + { + "name": "xl", + "targets": null, + "props": { + "shape": { + "type": "shape", + "value": "round.l" + }, + "height": { + "type": "dimension", + "value": 64 + }, + "paddingStart": { + "type": "dimension", + "value": 20 + }, + "paddingEnd": { + "type": "dimension", + "value": 20 + }, + "minWidth": { + "type": "dimension", + "value": 64 + }, + "iconSize": { + "type": "dimension", + "value": 24 + }, + "spinnerSize": { + "type": "dimension", + "value": 24 + }, + "spinnerStrokeWidth": { + "type": "dimension", + "value": 2 + } + } + }, + { + "name": "l", + "targets": null, + "props": { + "shape": { + "type": "shape", + "value": "round.l", + "adjustment": -2 + }, + "height": { + "type": "dimension", + "value": 56 + }, + "paddingStart": { + "type": "dimension", + "value": 16 + }, + "paddingEnd": { + "type": "dimension", + "value": 16 + }, + "minWidth": { + "type": "dimension", + "value": 56 + }, + "iconSize": { + "type": "dimension", + "value": 24 + }, + "spinnerSize": { + "type": "dimension", + "value": 22 + }, + "spinnerStrokeWidth": { + "type": "dimension", + "value": 2 + } + } + }, + { + "name": "m", + "targets": null, + "props": { + "shape": { + "type": "shape", + "value": "round.m" + }, + "height": { + "type": "dimension", + "value": 48 + }, + "paddingStart": { + "type": "dimension", + "value": 12 + }, + "paddingEnd": { + "type": "dimension", + "value": 12 + }, + "minWidth": { + "type": "dimension", + "value": 48 + }, + "iconSize": { + "type": "dimension", + "value": 24 + }, + "spinnerSize": { + "type": "dimension", + "value": 22 + }, + "spinnerStrokeWidth": { + "type": "dimension", + "value": 2 + } + } + } + ] + }, + { + "id": "shape", + "name": "shape", + "values": [ + { + "name": "rounded", + "targets": null, + "props": null + }, + { + "name": "pilled", + "targets": null, + "props": { + "shape": { + "type": "shape", + "value": "round.circle" + } + } + } + ] + }, + { + "id": "view", + "name": "view", + "values": [ + { + "name": "default", + "targets": null, + "props": { + "iconColor": { + "type": "color", + "value": "text.inverse.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.inverse.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.inverse.primary-hover" + } + ] + }, + "spinnerColor": { + "type": "color", + "value": "text.inverse.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.inverse.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.inverse.primary-hover" + } + ] + }, + "backgroundColor": { + "type": "color", + "value": "surface.default.solid-default", + "states": [ + { + "state": [ + "pressed" + ], + "value": "surface.default.solid-default-active" + }, + { + "state": [ + "hovered" + ], + "value": "surface.default.solid-default-hover" + } + ] + } + } + }, + { + "name": "secondary", + "targets": null, + "props": { + "iconColor": { + "type": "color", + "value": "text.default.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.default.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.default.primary-hover" + } + ] + }, + "spinnerColor": { + "type": "color", + "value": "text.default.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.default.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.default.primary-hover" + } + ] + }, + "backgroundColor": { + "type": "color", + "value": "surface.default.transparent-secondary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "surface.default.transparent-secondary-active" + }, + { + "state": [ + "hovered" + ], + "value": "surface.default.transparent-secondary-hover" + } + ] + } + } + }, + { + "name": "accent", + "targets": null, + "props": { + "iconColor": { + "type": "color", + "value": "text.on-dark.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.on-dark.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.on-dark.primary-hover" + } + ] + }, + "spinnerColor": { + "type": "color", + "value": "text.on-dark.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.on-dark.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.on-dark.primary-hover" + } + ] + }, + "backgroundColor": { + "type": "color", + "value": "surface.default.accent", + "states": [ + { + "state": [ + "pressed" + ], + "value": "surface.default.accent-active" + }, + { + "state": [ + "hovered" + ], + "value": "surface.default.accent-hover" + } + ] + } + } + }, + { + "name": "accent", + "targets": [ + { + "properties": [ + { "id": "size", "value": "l" }, + { "id": "shape", "value": "pilled" } + ] + }, + { + "properties": [ + { "id": "size", "value": "m" }, + { "id": "shape", "value": "pilled" } + ] + } + ], + "props": { + "iconColor": { + "type": "color", + "value": "text.inverse.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.inverse.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.inverse.primary-hover" + } + ] + }, + "spinnerColor": { + "type": "color", + "value": "text.inverse.primary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.inverse.primary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.inverse.primary-hover" + } + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/sdds-core/config-codec/src/test/resources/text_field_common.json b/sdds-core/config-codec/src/test/resources/text_field_common.json new file mode 100644 index 000000000..7e11851c0 --- /dev/null +++ b/sdds-core/config-codec/src/test/resources/text_field_common.json @@ -0,0 +1,1510 @@ +{ + "rootVariationId": "size", + "colorSchemeVariationId": "view", + "invariants": { + "disableAlpha": { + "type": "float", + "value": 0.4 + }, + "prefixPadding": { + "type": "dimension", + "value": 6.0 + }, + "suffixPadding": { + "type": "dimension", + "value": 6.0 + }, + "captionPlacement": { + "type": "value", + "value": "outer" + }, + "counterPlacement": { + "type": "value", + "value": "outer" + }, + "captionStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "counterStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "optionalPadding": { + "type": "dimension", + "value": 4.0 + }, + "helperTextPadding": { + "type": "dimension", + "value": 4.0 + }, + "chipsPadding": { + "type": "dimension", + "value": 6.0 + }, + "valueColor": { + "type": "color", + "default": "text.default.primary" + }, + "startContentColor": { + "type": "color", + "default": "text.default.secondary" + }, + "endContentColor": { + "type": "color", + "default": "text.default.secondary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.default.secondary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.default.secondary-hover" + } + ] + }, + "endContentColorReadOnly": { + "type": "color", + "default": "text.default.secondary", + "alpha": 0.4 + }, + "optionalColor": { + "type": "color", + "default": "text.default.tertiary" + }, + "counterColor": { + "type": "color", + "default": "text.default.secondary" + }, + "placeholderColor": { + "type": "color", + "default": "text.default.secondary", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.tertiary" + } + ] + }, + "placeholderColorReadOnly": { + "type": "color", + "default": "text.default.secondary" + }, + "backgroundColorReadOnly": { + "type": "color", + "default": "surface.default.solid-primary", + "alpha": 0.4 + }, + "indicatorColor": { + "type": "color", + "default": "surface.default.negative" + }, + "cursorColor": { + "type": "color", + "default": "text.default.accent" + }, + "captionColorReadOnly": { + "type": "color", + "default": "text.default.secondary" + }, + "prefixColor": { + "type": "color", + "default": "text.default.tertiary" + }, + "suffixColor": { + "type": "color", + "default": "text.default.tertiary" + } + }, + "variations": [ + { + "id": "view", + "name": "view", + "values": [ + { + "name": "default", + "props": { + "captionColor": { + "type": "color", + "default": "text.default.secondary" + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-primary", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + { + "name": "success", + "props": { + "captionColor": { + "type": "color", + "default": "text.default.positive", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-positive", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + { + "name": "warning", + "props": { + "captionColor": { + "type": "color", + "default": "text.default.warning", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-warning", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + { + "name": "error", + "props": { + "captionColor": { + "type": "color", + "default": "text.default.negative", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-negative", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + } + ] + }, + { + "id": "size", + "name": "size", + "values": [ + { + "name": "xs", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.s", + "adjustment": 0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.xs.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 32.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 32.0 + }, + "startContentSize": { + "type": "dimension", + "value": 16.0 + }, + "endContentSize": { + "type": "dimension", + "value": 16.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "name": "s", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m", + "adjustment": -2.0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.s.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 6.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 40.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 40.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "name": "m", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m" + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.m.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 14.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 14.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 12.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 6.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 48.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 48.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "name": "l", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m", + "adjustment": 2.0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.l.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 16.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 10.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 56.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 56.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "name": "xl", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.l" + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.xl.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 18.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 18.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 20.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 20.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 10.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 64.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 64.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + } + ] + }, + { + "id": "requirePlacement", + "name": "requirePlacement", + "values": [ + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xs" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "s" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "s" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "name": "required-end", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xs" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "s" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "s" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xs" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "name": "required-end", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xs" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 2.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "s" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "name": "required-end", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "s" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "m" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "l" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "m" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "m" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "l" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "l" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "name": "required-end", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "m" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "m" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "l" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "l" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + }, + { + "id": "labelPlacement", + "value": "inner-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "m" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 7.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "name": "required-start", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "l" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + }, + { + "id": "labelPlacement", + "value": "outer-label" + } + ] + } + ], + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + } + ] + }, + { + "id": "labelPlacement", + "name": "labelPlacement", + "values": [ + { + "name": "outer-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xs" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 6.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "name": "outer-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "s" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 8.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.s.normal" + } + } + }, + { + "name": "inner-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "s" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 0.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 4.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 4.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "name": "outer-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "m" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 10.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.m.normal" + } + } + }, + { + "name": "inner-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "m" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 6.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 6.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "name": "outer-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "l" + } + ] + }, + { + "properties": [ + { + "id": "size", + "value": "xl" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 12.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.l.normal" + } + } + }, + { + "name": "inner-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "l" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 9.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 9.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "name": "inner-label", + "targets": [ + { + "properties": [ + { + "id": "size", + "value": "xl" + } + ] + } + ], + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 13.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 13.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/sdds-core/config-codec/src/test/resources/text_field_native.json b/sdds-core/config-codec/src/test/resources/text_field_native.json new file mode 100644 index 000000000..6568e3ef1 --- /dev/null +++ b/sdds-core/config-codec/src/test/resources/text_field_native.json @@ -0,0 +1,1520 @@ +{ + "view": { + "default": { + "props": { + "captionColor": { + "type": "color", + "default": "text.default.secondary" + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-primary", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + "success": { + "props": { + "captionColor": { + "type": "color", + "default": "text.default.positive", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-positive", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + "warning": { + "props": { + "captionColor": { + "type": "color", + "default": "text.default.warning", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-warning", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + }, + "error": { + "props": { + "captionColor": { + "type": "color", + "default": "text.default.negative", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.secondary" + } + ] + }, + "backgroundColor": { + "type": "color", + "default": "surface.default.transparent-negative", + "states": [ + { + "state": [ + "activated" + ], + "value": "surface.default.transparent-secondary" + } + ] + } + } + } + }, + "props": { + "disableAlpha": { + "type": "float", + "value": 0.4 + }, + "prefixPadding": { + "type": "dimension", + "value": 6.0 + }, + "suffixPadding": { + "type": "dimension", + "value": 6.0 + }, + "captionPlacement": { + "type": "value", + "value": "outer" + }, + "counterPlacement": { + "type": "value", + "value": "outer" + }, + "captionStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "counterStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "optionalPadding": { + "type": "dimension", + "value": 4.0 + }, + "helperTextPadding": { + "type": "dimension", + "value": 4.0 + }, + "chipsPadding": { + "type": "dimension", + "value": 6.0 + }, + "valueColor": { + "type": "color", + "default": "text.default.primary" + }, + "startContentColor": { + "type": "color", + "default": "text.default.secondary" + }, + "endContentColor": { + "type": "color", + "default": "text.default.secondary", + "states": [ + { + "state": [ + "pressed" + ], + "value": "text.default.secondary-active" + }, + { + "state": [ + "hovered" + ], + "value": "text.default.secondary-hover" + } + ] + }, + "endContentColorReadOnly": { + "type": "color", + "default": "text.default.secondary", + "alpha": 0.4 + }, + "optionalColor": { + "type": "color", + "default": "text.default.tertiary" + }, + "counterColor": { + "type": "color", + "default": "text.default.secondary" + }, + "placeholderColor": { + "type": "color", + "default": "text.default.secondary", + "states": [ + { + "state": [ + "activated" + ], + "value": "text.default.tertiary" + } + ] + }, + "placeholderColorReadOnly": { + "type": "color", + "default": "text.default.secondary" + }, + "backgroundColorReadOnly": { + "type": "color", + "default": "surface.default.solid-primary", + "alpha": 0.4 + }, + "indicatorColor": { + "type": "color", + "default": "surface.default.negative" + }, + "cursorColor": { + "type": "color", + "default": "text.default.accent" + }, + "captionColorReadOnly": { + "type": "color", + "default": "text.default.secondary" + }, + "prefixColor": { + "type": "color", + "default": "text.default.tertiary" + }, + "suffixColor": { + "type": "color", + "default": "text.default.tertiary" + } + }, + "variations": [ + { + "id": "xs", + "kind": "size", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.s", + "adjustment": 0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.xs.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 32.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 32.0 + }, + "startContentSize": { + "type": "dimension", + "value": 16.0 + }, + "endContentSize": { + "type": "dimension", + "value": 16.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "id": "s", + "kind": "size", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m", + "adjustment": -2.0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.s.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 4.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 6.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 40.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 40.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "id": "m", + "kind": "size", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m" + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.m.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 14.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 14.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 12.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 12.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 6.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 48.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 48.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "id": "l", + "kind": "size", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.m", + "adjustment": 2.0 + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.l.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 16.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 16.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 10.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 56.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 56.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "id": "xl", + "kind": "size", + "props": { + "labelPlacement": { + "type": "value", + "value": "none" + }, + "shape": { + "type": "shape", + "value": "round.l" + }, + "chipGroupStyle": { + "type": "component_style", + "value": "embedded-chip-group-dense.xl.secondary" + }, + "boxPaddingStart": { + "type": "dimension", + "value": 18.0 + }, + "boxPaddingEnd": { + "type": "dimension", + "value": 18.0 + }, + "boxPaddingTop": { + "type": "dimension", + "value": 20.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 20.0 + }, + "startContentPadding": { + "type": "dimension", + "value": 8.0 + }, + "endContentPadding": { + "type": "dimension", + "value": 10.0 + }, + "boxMinHeight": { + "type": "dimension", + "value": 64.0 + }, + "alignmentMinHeight": { + "type": "dimension", + "value": 64.0 + }, + "startContentSize": { + "type": "dimension", + "value": 24.0 + }, + "endContentSize": { + "type": "dimension", + "value": 24.0 + }, + "valueStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "placeholderStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "prefixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "suffixStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "fieldType": { + "type": "value", + "value": "optional" + } + } + }, + { + "id": "xs.required-start", + "kind": "requirePlacement", + "parent": "xs", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "s.required-start", + "kind": "requirePlacement", + "parent": "s", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "s.inner-label.required-start", + "kind": "requirePlacement", + "parent": "s.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xs.required-end", + "kind": "requirePlacement", + "parent": "xs", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "s.required-end", + "kind": "requirePlacement", + "parent": "s", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "s.inner-label.required-end", + "kind": "requirePlacement", + "parent": "s.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xs.outer-label.required-start", + "kind": "requirePlacement", + "parent": "xs.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "xs.outer-label.required-end", + "kind": "requirePlacement", + "parent": "xs.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 2.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "s.outer-label.required-start", + "kind": "requirePlacement", + "parent": "s.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 6.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "s.outer-label.required-end", + "kind": "requirePlacement", + "parent": "s.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "m.outer-label.required-end", + "kind": "requirePlacement", + "parent": "m.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "l.outer-label.required-end", + "kind": "requirePlacement", + "parent": "l.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "xl.outer-label.required-end", + "kind": "requirePlacement", + "parent": "xl.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 4.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 4.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "m.required-start", + "kind": "requirePlacement", + "parent": "m", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "m.inner-label.required-start", + "kind": "requirePlacement", + "parent": "m.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "l.required-start", + "kind": "requirePlacement", + "parent": "l", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "l.inner-label.required-start", + "kind": "requirePlacement", + "parent": "l.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xl.required-start", + "kind": "requirePlacement", + "parent": "xl", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xl.inner-label.required-start", + "kind": "requirePlacement", + "parent": "xl.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "m.required-end", + "kind": "requirePlacement", + "parent": "m", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "m.inner-label.required-end", + "kind": "requirePlacement", + "parent": "m.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "l.required-end", + "kind": "requirePlacement", + "parent": "l", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "l.inner-label.required-end", + "kind": "requirePlacement", + "parent": "l.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xl.required-end", + "kind": "requirePlacement", + "parent": "xl", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "xl.inner-label.required-end", + "kind": "requirePlacement", + "parent": "xl.inner-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredEnd" + }, + "indicatorSize": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "inside" + } + } + }, + { + "id": "m.outer-label.required-start", + "kind": "requirePlacement", + "parent": "m.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 7.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "l.outer-label.required-start", + "kind": "requirePlacement", + "parent": "l.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "xl.outer-label.required-start", + "kind": "requirePlacement", + "parent": "xl.outer-label", + "props": { + "fieldType": { + "type": "value", + "value": "requiredStart" + }, + "indicatorSize": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetX": { + "type": "dimension", + "value": 6.0 + }, + "indicatorOffsetY": { + "type": "dimension", + "value": 8.0 + }, + "indicatorAlignmentMode": { + "type": "value", + "value": "outside" + } + } + }, + { + "id": "xs.outer-label", + "kind": "labelPlacement", + "parent": "xs", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 6.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 8.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 8.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "id": "s.outer-label", + "kind": "labelPlacement", + "parent": "s", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 8.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.s.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.s.normal" + } + } + }, + { + "id": "s.inner-label", + "kind": "labelPlacement", + "parent": "s", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 0.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 4.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 4.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "id": "m.outer-label", + "kind": "labelPlacement", + "parent": "m", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 10.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.m.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.m.normal" + } + } + }, + { + "id": "m.inner-label", + "kind": "labelPlacement", + "parent": "m", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 6.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 6.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "id": "l.outer-label", + "kind": "labelPlacement", + "parent": "l", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 12.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.l.normal" + } + } + }, + { + "id": "xl.outer-label", + "kind": "labelPlacement", + "parent": "xl", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.primary" + }, + "labelPlacement": { + "type": "value", + "value": "outer" + }, + "labelPadding": { + "type": "dimension", + "value": 12.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.l.normal" + }, + "optionalStyle": { + "type": "typography", + "value": "body.l.normal" + } + } + }, + { + "id": "l.inner-label", + "kind": "labelPlacement", + "parent": "l", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 9.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 9.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + }, + { + "id": "xl.inner-label", + "kind": "labelPlacement", + "parent": "xl", + "props": { + "labelColor": { + "type": "color", + "default": "text.default.secondary" + }, + "labelPlacement": { + "type": "value", + "value": "inner" + }, + "labelPadding": { + "type": "dimension", + "value": 2.0 + }, + "labelStyle": { + "type": "typography", + "value": "body.xs.normal" + }, + "boxPaddingTop": { + "type": "dimension", + "value": 13.0 + }, + "boxPaddingBottom": { + "type": "dimension", + "value": 13.0 + }, + "optionalStyle": { + "type": "typography", + "value": "body.xs.normal" + } + } + } + ] +} \ No newline at end of file diff --git a/sdds-core/settings.gradle.kts b/sdds-core/settings.gradle.kts index 8ac1c3a3e..bb439e5a4 100644 --- a/sdds-core/settings.gradle.kts +++ b/sdds-core/settings.gradle.kts @@ -32,4 +32,5 @@ include( ":docs-views", ":docs-compose", ":docs-ksp", + ":config-codec" )