Files
metabuilder/qml/components/form/CFormGroup.qml
T
git c406b8df96 refactor: Reorganize FakeMUI by implementation type
Move FakeMUI content to appropriate root-level folders by implementation:

**React Components → components/fakemui/**
- 537 components (inputs, surfaces, layout, data-display, feedback,
  navigation, utils, atoms, lab, x, email, workflows)
- 416 SVG icons
- Full barrel exports in components/fakemui/index.ts

**QML Components → qml/**
- 104 Material Design 3 components (11 categories)
- 7 hybrid application views
- 8 desktop widgets
- qmldir module registration

**Python Bindings → python/fakemui/**
- 15 PyQt6 modules (120+ components)
- Full Python package structure with pyproject.toml

**SCSS/Styles → fakemui/** (renamed purpose)
- scss/ - Material Design 3 stylesheets
- styles/ - Component SCSS modules
- src/utils/ - Accessibility utilities
- index.ts now re-exports from components/fakemui/

This separation allows:
- React: import { Button } from '@metabuilder/components/fakemui'
- QML: import QmlComponents 1.0
- Python: from fakemui import Button, Card
- Backward compat: import { Button } from '@metabuilder/fakemui'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:59:24 +00:00

60 lines
1.5 KiB
QML

import QtQuick
import QtQuick.Layouts
/**
* CFormGroup.qml - Form field container (mirrors _form.scss)
* Groups label, input, and helper/error text
*/
ColumnLayout {
id: root
property string label: ""
property string helperText: ""
property string errorText: ""
property bool required: false
property bool disabled: false
default property alias content: contentArea.data
spacing: StyleVariables.spacingXs
// Label
RowLayout {
Layout.fillWidth: true
spacing: 2
visible: root.label !== ""
Text {
text: root.label
color: root.disabled ? Theme.onSurfaceVariant : Theme.onSurface
font.pixelSize: StyleVariables.fontSizeSm
font.weight: Font.Medium
opacity: root.disabled ? 0.6 : 1
}
Text {
text: "*"
color: Theme.error
font.pixelSize: StyleVariables.fontSizeSm
visible: root.required
}
}
// Content slot (for input)
Item {
id: contentArea
Layout.fillWidth: true
implicitHeight: childrenRect.height
}
// Helper or error text
Text {
Layout.fillWidth: true
text: root.errorText || root.helperText
color: root.errorText ? Theme.error : Theme.onSurfaceVariant
font.pixelSize: StyleVariables.fontSizeXs
visible: text !== ""
wrapMode: Text.Wrap
}
}