From 17dfbf324a8f4af70079093e7df719656759dcde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Mon, 25 May 2026 07:20:17 +0200 Subject: [PATCH] feat(components): add labels and dual options to radio single-choice --- components/interactive-elements.html | 62 +++++++++++++++++----------- styleguide.css | 34 +++++++++++++++ 2 files changed, 73 insertions(+), 23 deletions(-) diff --git a/components/interactive-elements.html b/components/interactive-elements.html index a1d1008..08da3aa 100644 --- a/components/interactive-elements.html +++ b/components/interactive-elements.html @@ -451,33 +451,49 @@
Variante aktivierbar - - - - - Option 1 - - - - Option 2 + + + Label + + + + Option 1 + + + + Option 2 +
diff --git a/styleguide.css b/styleguide.css index 6f2b351..73201cc 100644 --- a/styleguide.css +++ b/styleguide.css @@ -1673,6 +1673,40 @@ section + section { gap: var(--spacing-small); } + #component-radio-field .sg-checkbox-field-option { + display: grid; + grid-template-columns: calc(var(--interaction-height) * 6) minmax(0, 1fr); + align-items: center; + column-gap: var(--spacing-small); + width: 100%; + } + + #component-radio-field .sg-checkbox-field-option .sg-state-example__label { + grid-column: 1; + margin-bottom: 0; + } + + #component-radio-field .sg-radio-field-row { + grid-column: 2; + display: inline-flex; + align-items: center; + gap: var(--spacing-small); + min-width: 0; + flex-wrap: wrap; + } + + @media (max-width: 48rem) { + #component-radio-field .sg-checkbox-field-option { + grid-template-columns: 1fr; + align-items: start; + } + + #component-radio-field .sg-checkbox-field-option .sg-state-example__label, + #component-radio-field .sg-radio-field-row { + grid-column: 1; + } + } + .sg-checkbox-field-option--disabled { color: var(--text-control-disabled); opacity: var(--disabled-opacity);