Files
metabuilder/fakemui/qml-components/atoms/CSection.qml
JohnDoe6345789 58a94d0489 feat(styles): add component-specific styles for TaskDetail, SearchDialog, and Documentation
feat(styles): create global styles entry point and organize global styles

feat(styles): implement base HTML element styles and utility classes for flexbox

feat(styles): establish layout, position, spacing, and text utility classes

feat(styles): introduce mixins for animations, cards, dialogs, flexbox, grid, and responsive design

test(quick_guide): add component and metadata validation tests for quick_guide package

test(ui_level6): implement metadata validation tests for ui_level6 package
2025-12-30 02:29:58 +00:00

64 lines
1.6 KiB
QML

import QtQuick
import QtQuick.Layouts
/**
* CSection.qml - Content section (mirrors _section.scss)
* Groups related content with optional title
*/
ColumnLayout {
id: root
property string title: ""
property string subtitle: ""
property bool divider: false
property string spacing: "md" // sm, md, lg
default property alias content: contentItem.data
spacing: {
switch (root.spacing) {
case "sm": return StyleVariables.spacingSm
case "lg": return StyleVariables.spacingLg
default: return StyleVariables.spacingMd
}
}
// Header
ColumnLayout {
Layout.fillWidth: true
spacing: StyleVariables.spacingXs
visible: root.title !== "" || root.subtitle !== ""
Text {
Layout.fillWidth: true
text: root.title
color: Theme.onSurface
font.pixelSize: StyleVariables.fontSizeLg
font.weight: Font.DemiBold
visible: root.title !== ""
}
Text {
Layout.fillWidth: true
text: root.subtitle
color: Theme.onSurfaceVariant
font.pixelSize: StyleVariables.fontSizeSm
wrapMode: Text.Wrap
visible: root.subtitle !== ""
}
}
// Divider after header
CDivider {
Layout.fillWidth: true
visible: root.divider && root.title !== ""
}
// Content
Item {
id: contentItem
Layout.fillWidth: true
implicitHeight: childrenRect.height
}
}