mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 06:44:58 +00:00
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
64 lines
1.6 KiB
QML
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
|
|
}
|
|
}
|